The issue here, Floof, is that neither you nor your dd are medically qualified to differentiate between diarrhoea caused by an infection, and diarrhoea caused by 'something she ate' - and if you don't keep her off school when she has some nasty stomach bug, you risk spreading it around the whole school.
You make a parallel with your gluten allergy - which you don't have the evidence to make. Obviously, if your dd had a diagnosed allergy to gluten, that caused diarrhoea, and she'd eaten gluten and had some hours of diarrhoea afterwards, I would understand your feeling that it was safe for her to go to school.
But, unless you have forgotten something pretty big from your OP, she doesn't have a diagnosed gluten allergy - nor have you said that she gets some hours of diarrhoea every time she eats gluten (or any other food or food group), so there is no evidence to suggest this was an allergy.
Also, in your OP, you say that there is a nasty bug going around the school at the moment - that, plus no diagnosed allergy would make me more likely to think infection than bad reaction to a particular food group, in this instance.
It might have been 'something she ate' in that GI bugs usually enter via the digestive system - she could have eaten something that was contaminated, or could have picked the bug up from a poorly cleaned surface (maybe at school, where some other parent had sent their child in too soon after diarrhoea caused by a GI bug) and unwittingly transferred it into her mouth via food she was eating or by chewing her finger nails etc.
Given that you say the 48 hour rule doesn't exist in secondary schools, my advice would be to keep her off for 48 hours after her poo goes back to something more normal - to minimise the risk of her spreading infection round the school.