Where I am, there are four possible outcomes of a viva:
- Outright pass (I've never known this happen in the five years I've been around the place!)
- Pass with minor corrections (most people get this), which means that small changes like typos or formatting have to be corrected. The viva doesn't have to be repeated, but the corrected thesis must be approved by supervisors.
- Major corrections (only known one of these). A substantial part of the research is incomplete or needs to be reworked. The thesis has to be significantly improved and resubmitted, and the viva must be repeated.
- Outright fail (I've never known this happen).
If your worst fears are true, then you'll either get the third or fourth option. Pragmatically, it's not in the uni's interest to have you fail as this reflects badly on the organisation, the department and your supervisors. Wherever possible, an inadequate thesis will be returned with Major Corrections after the viva, and the candidate will be given a further chance. It's only my opinion, but I'd think that your thesis would have to be an utter disaster area with no redeeming features and no mitigation, in order for it to be failed completely on first submission. It doesn't sound as if that's the case.
If the writing is poor, then the viva is partly intended to gauge whether you actually have a good understanding of your subject, rather than just some kind of problem writing it. You could be in for a sound grilling, but as long as you know your stuff and you have a decent viva panel, you'll be able to discuss the shortcomings of the thesis whilst still being able to communicate your knowledge.