  Loads of places have a dress code - so if a school does you should adhere to it. Vaping is illegal for children in this country.  A detention is a disciplinary procedure - one that has an impact they don’t like.  It works for many - it’s called a deterrent. 