Hard as it is to imagine, there are people out there who loathe garlic and onions. Some might have allergies or medical conditions like IBS, or are supertasters (i.e. people who carry a certain gene that makes them extremely sensitive to how certain foods taste). Others might just be picky eaters.
The real question is how do we cook for those folks? Garlic and onions are the heart of most tasty cuisines and dishes around the world.
Off the top of my head, the only dishes I can think to make that don't involve garlic or onions are suitable mostly for kids: scrambled eggs, French fries, and grilled cheese sandwiches, or a nice pan-fried salted steak. And while all of those items are delicious, you can't eat them night after night.
Never fear: the rich flavors of garlic and onions can be duplicated or mimicked with the careful and clever use of other vegetables, herbs, and cooking ingredients, once you know where to look.
Chives, leeks (the white parts only), shallots (the fancier, gentler cousin of onions and one of the reasons why restaurant food always tastes so good), and green onions (also known as scallions) all pack a lot of flavor, but without the particular strength and pungency that onion haters vilify.
Leeks, shallots, and the white base of green onions in particular are hearty and can be sweated and sautéed (or even caramelized) and used as a flavor base much the way onions would be. Chives and the green part of green onions are more delicate and are better off used as garnishes or tossed into your cooking at the last moment so they won't burn.
Asafetida, a root native to Iran and India, has a rich, hearty, and savory character. It's usually sold as a powder in Indian grocery stores.
A little goes a long way. In fact, the pungency of this spice might alarm you at first. Serious Eats recommends that you don't use it straight (it's best to sauté it in a little fat first, like oil or butter, where it mellows out and gives off a flavor similar to a hybrid garlic-onion) and that you use it as a complement to other spices, like cumin and paprika.
However, keep in mind that all of these suggestions belong to the family of alliums like garlic and onions. If you have a physical allergy, skip these. Fun fact: asafetida is said to prevent flatulence, so it's just the thing when making beans.
Not to worry: other vegetables can mimic the aromatic effect of onions and their texture, too: try fennel bulb, minced and diced. Cooked long enough, it loses its anise flavor (although that's actually one of the things I love about it) and becomes mellow, rich, and slightly sweet.
Celery will make a good substitute as well since it's also an aromatic vegetable, i.e., it gives off a rich flavor and aroma when cooked.
Over at the Cheftalk forums, there are dozens of good suggestions, ranging from diced celery used along with celery seed powder and cumin to mimic the rich depth of onions to using kohlrabi and jicama to simulate the texture of onions.
I'd also suggest using radishes. Their peppery character with its undertones of sulfur are more akin to onions than you might think, and they lose their harsher aspects when sautéed in a little oil.
To me, a kitchen without garlic seems naked and sad, but if you must cook without it, there are good alternatives.
For people who aren't allergic to garlic but dislike its strong bite and pungency, there are many alternatives, and they're mostly garlic in its younger state, before its bulb reaches full growth.
Scapes are long, tender green stems that garlic produces before the bulbs mature. They're amazing when sautéed or flash-fried in good olive oil: crisp-tender, flavorful, but mellow, without the harshness of actual garlic.
While many people use ramps and scapes interchangeably, garlic ramps are actually different. Ramps (or wild leeks) have one or two wide leaves and a small, tender white bulb. They have a sharp flavor when raw and when cooked, are an amazing mixture of garlic and onion flavors.
Green garlic (or spring garlic) are exactly that: garlic that's been harvested before it reaches full maturity. The bulbs don't need to be peeled and the jade-green stalks can also be eaten. The garlic flavor is simultaneously rich and mild and has nutty, earthy undertones.
A relatively recent arrival on the culinary scene, black garlic is regular garlic that's been fermented and aged to caramelize the sugars present in garlic. Tasters say it is simultaneously savory and sweet, with notes of balsalmic, chocolate, caramel, or even licorice. In Korea, it's prized for its antioxidant properties.
Stone Soup has a great suggestion to mimic the robust flavor profile of garlic: use ginger combined with chili powder. No, it won't taste like garlic at all, but its spicy-sweet taste combined with the chili's heat will provide depth and aroma for whatever dish you're preparing, especially in Asian cooking.
If you're preparing something Mediterranean or Middle Eastern, you might want to try using cumin as a garlic substitute. Its rich, savory character will go a long way to disguise the lack of garlic in whatever you're cooking.