I was thinking of the GP if you threw up in the exam, to back the invigilator.
For sick beforehand, I think it depends on what... if you skip the exam, put in a form saying you felt unwell with no details and had a medical certificate stating you had a sprained nostril hair, I doubt you'd get much sympathy.
If you were having a massive chest pains, vomiting, difficulty standing, and were taken to hospital by ambulance with a possible heart attack and rushed for emergency surgery, I think general well-being says medical treatment first and if you have to fight with NESA, assume common sense will have the medical staff, your parents, your school, and members of the media behind you.
There is plenty of room between these extremes for judgement as to what is best. In the case of anxiety that is into the panic attack, need urgent intervention category (and not just a bad case of nervousness), going to school to see the invigilators w=is not necessarily medically wise. If needed, I would suggest a parent accompany you and speak to the school to provide support and reassurance that you won't be pressured to do the exam and try to get by if you are genuinely not physically capable.
I know of a case where a student on the way to school for a Trial HSC exam when a pedestrian about a metre away stepped out onto the road and was hit by a bus. The school advised the student to just "put it out of your mind and focus on the exam" and did nothing further... I mention this because there are still people around with the attitude to just be tough and cope when that is not an adequate response.