Most people can eat onion in food without any difficulties. Higher intakes of onion may worsen existing heartburn, though it does not seem to cause heartburn in people who do not already have it.34 There are also isolated reports of allergy to onion, including among people with asthma,35 manifesting as skin rash and red, itchy eyes.
Raw garlic is very strong, so eating too much could produce problems, for example irritation of or even damage to the digestive tract.
There are a few people who are allergic to garlic. Symptoms of garlic allergy include skin rash, temperature and headaches. Also, garlic could potentially disrupt anti-coagulants, so it's best avoided before surgery. As with any medicine, always check with your doctor first and tell your doctor if you are using it.