Like diarrhea, vomiting can be caused by any number of problems, including anxiety or excitement, eating too quickly, or eating something that doesn't agree with the digestive system. Vomiting is also a sign of some infectious or chronic diseases.
If your pug is healthy and you suspect the vomiting is related to eating something that gave him an upset stomach, withhold food and water for twelve hours, then feed a bland meal such as boiled chicken and rice. Give only one or two tablespoons at first to make sure your dog can keep the food down. If he can, gradually return him to his regular food.
Take your pug to the veterinarian if he has projectile (violent) vomiting, if the vomit smells like feces, if the vomiting is accompanied by diarrhea, if the vomiting continues even though the dog hasn't had any food, or if the vomit contains blood or worms.