There is no difference between attending school to take a public exam and attending lessons on normal days. The school has a clear right to determine the standards of personal
presentation it requires of pupils and to enforce them. Some schools deliberately choose to relax them in the exam season, others do not.
No year passes without some pupils attempting to challenge authority at this time. A sensible school plans in advane for this by making clear to parents and pupils what is expected of them. What to do with the inevitable rebels is a matter of judgment. In general, there is a disposition to put the pupil's long-term interest first, even if he - and it is usually he - has failed to do so.
Although it is not always
possible, allowing him to take the paper segregated from his peers on the first offence, followed by swift intervention with his parents, will make the point. If it does not, then the head must decide what to do and be sure that the governors are supportive of any action that is taken.