You can 'fail' a viva in several ways. If the thesis was OK, but you did very badly in the viva (unusual), you can resit the viva after more preparation. If the thesis was not OK you can be asked to do more experiments and resubmit another thesis, receive a Masters rather than PhD, or fail outright (no resubmission allowed). For the thesis not to be OK means that the supervisor does not know their stuff, or that the student has ignored their advice.
Examiners are actually reluctant to fail a thesis for fear of being involved in legal action!