That’s an interesting perspective and definitely worth thinking about.
In a libertarian society, it would probably work like that: a school could set its own dress code, just as many schools already do today. Parents would then be free to decide whether or not they want to sign that agreement and send their child there.
At the moment, what people consider appropriate or inappropriate is probably shaped much more by cultural norms and habits than by formal rules. And those norms can change quite a bit over time and between different communities.
