I suppose, but if I were allergic to pumpkin, I'd feel really uncomfortable with being asked to touch and decorate one. I don't know if touching the skin could yield hives, but I would refuse to touch a thoroughly washed peanut, for instance. I don't know enough about pumpkin allergy though, as it is extremely rare. If nobody in the class has a pumpkin allergy, I'd see it as reasonable and acceptable since it's not being used with any intention for consumption.
But something to think about.