It definitely can be! Dogs can vomit right after eating something that they're allergic to.