This is such a difficult topic, as dealing with life-threatening allergies for children demand so much attention and understanding from all parties. Schools take this seriously, but unfortunately in the busy life of a school, mistakes can happen. The bigger the school, the more difficult it is to get the message across that, for example, everyone adopts a nut-free policy. Sometimes, some homes are not aligned with school rules and this is where it can fall down, putting children at risk. The answer, I believe, simply involves the child in question, gradually over time, being educated on food groups and allergies. It is so important that the child learns to personally manage their health themselves. Schools will help with supportive rules. However, if a child knows the signs of where food allergies are present around them, especially at eating time, the greater capacity they have of being safe from attacks.
Without going into much detail, children can learn that sometimes surfaces, where other children have eaten, can contain some contaminates that they need to be aware of. I hear you say, how hard it is for a child to feel that they have to own their condition. I believe that the more a child takes ownership of their health, the safer and ultimately the happier they will be. There is nothing more satisfying than being in charge yourself. It takes away so much fear and anxiety.