My friend wore a dress to school the day of homecoming, and to the actual homecoming dance. He wasn't some stupid 'agender' bullstuff either, his girlfriend wore a suit and he wore a dress, it was for stuffs and giggles.
Schools have different dress-code rules, and I don't know your school's dress code, or the dress type so I can't give my opinion clearly. On the other hand, I can base it off of my school's dress code.
Males that wear any type of clothing must be wearing at least short sleeves (no tank tops), so that probably rules out the dress unless he was wearing a t-shirt under it. Now, I don't loving care if you say "b-but my friend is agender hes not male of female!" because he has either a snake or a vagina, and that's what the school idetifies your gender as because your friend is just a stupid grade-schooler that is trying hard to trigger people and bend the rules. He is either male or female, and there are rules enforcing dress code for both actual genders.
Post a picture of the dress so we can see if it was at least somewhat appropriate.