DfE guidance states that allergy is classed as a medical condition and schools have a duty to support pupils at their school with medical diets and should make reasonable adjustments so children can participate fully and safely – and remove barriers to participating in school life.
The ideal and most inclusive solution would be for all children to take part in a cooking activity that does not include any ingredients that any children in the class are allergic to.