My kids have been in classrooms where they were expected to not bring foods besides nuts, due to allergies.
In one particular class my daughter was in, I could not send anything nut, coconut, flax, or sesame seed. It was expected that when dealing with anaphylactic issues, we honoured other people's health and safety. But, on a classroom level. You simply can't factor in an entire school's worth of kids' allergies.
The teacher even went so far as to make kids eat anything minty in the hallway, as the smell for some reason makes my daughter ill (not an accommodation we requested).
Elementary school is a challenging environment in terms of contamination from allergens, but even so, no one ever expected the entire school drop all allergens. They didn't even ban nuts from the school, just from the group foods, and if you ate nuts, you had to do it in the office.