Can the wrong food make a dog vomit?

I have a four-year-old Boxer who has a very strange thing happening. He is throwing up a foamy white discharge. He first threw up yellow…