Legally, someone could wear that shirt. Would it be wise? Probably not.
Also, there is a big difference between wearing something obscene into a courtroom, where the judge has total authority, and wearing something political into a public classroom.
The school may establish rules such as shorts/skirts must reach the knees etc. And schools may make restrictions regarding obscene or vulgar speech. But schools may NOT make restrictions on political speech.