Like " I had insomnia last night" and "I am so OCD", medical terms often become colloquial. So it is with people who say they had a "stomach flu."
There are stomach virusus, but what many people commonly call “stomach flu” isn’t flu at all. "Flu" is short for influenza, and that is respiratory so it involves lungs, not the stomach. What people call a stomach flu is instead viral gastroenteritis. It could be rotavirus, norovirus, adenovirus or something else, and could have been through tainted food.