I went to two different schools with uniforms (primary and secondary). We were permitted to attend classes without our uniform if we had a note from our parents with an appropriate excuse. It didn't happen that often and wasn't a big problem. A bigger problem was students wearing filthy uniforms. Young kids don't care about their appearance and you would regularly see boys with mud covered shoes and pants, chocolate milk down the front of their shirt... I used to sleep in my uniform because I didn't like being cold in the morning, lol.
Anyways, I remember hating my uniform. By high school I was mortally embarrassed of it. i had other clothing I would put on over it for the walk to school in case a girl saw me! I was really happy to leave that school and never wear that ugly, cheaply made, uncomfortable uniform again.
We were always told that the intention of the uniform was to unify the student body, make all the students the same, remove any status and competition based on how you dressed, and to eliminate that distraction. Fine idea in theory, unfortunately it had a rebound effect on me and a lot of my classmates. As soon as we could choose our own clothing we all became punk rockers and dressed as outlandishly as we could manage.
I really believe uniforms are unnecessary. It's school, not the army (or prison). Uniforms are an anachronism of a more conservative, classist age.