Onions can, in fact, might cause gas in babies. If a mother eats food rich in spices and things like onion, or garlic, it might sometimes be problematic to the babies. Not all mothers follow this restriction and their babies turn out fine, so it rarely happens that onions might cause a gassy situation.  It varies from one child to another, and some might be tolerable and some not. Most babies are allergic to the things like dairy.