I really have a problem, because I can't stand either. The texture of onions between my teeth is one reason. And as for the smell of garlic - it makes me heave.
This makes cooking very difficult and the end results are usually bland, but there's nothing I can do about that.
The only vegetables I eat are peas, carrots, tomatoes, potatoes and turnip (swede). Although strangely I love the smell of fried onions.
My mother used onions in cooking, but even as a child I had an aversion to them. So I can't blame my upbringing.
All very strange.