I’m a teacher at an elementary school and my school does not have this store-bought-only rule for classroom snacks. They are, however, strict about what can be brought into certain classrooms because of student allergies. For holiday parties and birthday celebrations, teachers of students with peanut, gluten or other food-specific allergies should let parents know what kinds of things are appropriate, and what kinds of things should be avoided. That way there are no surprises or disappointed kids. Parents should also be sensitive about bringing in items that students with diabetes may not be able to enjoy. One student in my school is on a strict Kosher diet, so his snack choices are limited in other ways.
Parents at my school are very understanding and accommodating; For our Halloween celebration this year parents made or brought in alternative things like sugar-free cookies (easily made at home), string cheese poked with a pretzel stick to look like a witch’s broom, ends of peeled bananas decorated to look like ghosts, and orange pumpkin rice krispie treat balls. Still cute and holiday-fun, and Ok for everyone to eat!