My dog had the stomach flu a couple of weeks ago, and my vet told me the same thing, not to give food for 24 hours.

Which was hard for me to see my puppy go through that. But he did prescribe to give him some pepto-bismol and some medicine for the nausea. The dose might be differrent depending on the size/weight of dog. Anyway, the pepto worked, and my puppy started eating the next day.