The best substitute for a given food isn't always one-to-one -- that is, sometimes the right substitute for an allergenic food depends on how you're using it. The best way to replace an ingredient for baking might be completely different than the way you'd replace it for eating raw, or for cooking briefly in a savory recipe. Nonetheless, here is a list of basic pantry staples and some useful substitutes for each. Even where brand names have been indicated, always read labels carefully, as ingredients may have changed.
1. MilkNon-dairy milk substitutes, widely available in most supermarkets, are excellent substitutes for people with dairy allergies and lactose intolerance, whether for drinking, pouring over cereal, or cooking. Which dairy-free milk alternative to choose will depend on whether you prefer a mild tasting milk and whether you need a lot of protein (as, for example, for baking). For more information, see my rundown of Dairy-Free Milk Alternatives.
2. Ice Cream
Alternatives to ice cream fall into two categories: Those that are naturally dairy-free, and those that mimic the texture of ice cream. Naturally dairy-free frozen dessert alternatives include fruit sorbets, granitas, and frozen ices, though you should always check labels to ensure that small amounts of milk protein aren't added for binding. These desserts are usually quite sweet, and they're most commonly made from fruit. Dairy-free ice creams are sold under brand names including So Delicious and Tofutti, and they can be found in specialty groceries and some larger supermarkets. While their texture is far closer to ice cream, many are made from soy (itself a common allergen and stronger tasting than milk).
Most dairy-free butter alternatives are margarine, but not all margarine is dairy-free. Many margarines are made from dairy derivatives like calcium caseinate, so do read labels carefully. Brand names that, as of this writing, are dairy-free include Earth Balance and Fleischmann's. (While most margarines contain trans fats, which are dangerous to your heart, the two brands mentioned here are advertised as trans fat-free.) You'll find that margarine varies greatly in different brands' suitability for baking, but virtually all are fine for table use. If you need a dairy-free, soy-free alternative for baking, consider Spectrum Organics' Palm Oil Shortening.
About.com's Dairy-Free Cooking guide recommends coconut milk, soy coffee cream, or soy milk thickened with soy powder or melted margarine to replace cream.
5. Sour Cream
At least one dairy-free sour cream alternative exists: Tofutti's Sour Supreme. This vegan sour cream is tangy. Do note that it is quite thick, so plan accordingly if you're using it in baking: you may want to thin it slightly with a little bit of a mild-tasting milk alternative before mixing it into a batter.
For baking, the best alternative on the market is Ener-G's Egg Replacer, a leavening mixture that mimics eggs' role in baked goods. This product, however, cannot be used to replace scrambled eggs and will not generally work in egg-thickened sauces like Hollandaise. For more information, see Using Egg Replacer. You can see one alternative to eggs for everyday cooking in my Scrambled Tofu recipe.
7. Soy Sauce
If you're allergic to soy, you should be aware that no product currently on the market is a terrific alternative to soy sauce, especially in dips or as a condiment. However, in some cooked recipes, you may like Thai fermented fish sauce (or nam pla), which is almost always made without soy. For replacing wheat in traditionally brewed soy sauce, look for tamari soy sauce that is made without wheat. San-J is probably the most widely available brand. Bragg's Liquid Aminos are also a fine, unfermented wheat-free substitute for soy sauce.
Consider seitan, which is a meat substitute made from wheat gluten, as a soy-free substitute for tofu in some recipes. While its texture is not quite the same as tofu's, both are high in protein and can be used like meat in some soups and chilis. Be aware, though, that some commercial seitan may be flavored with soy. If you're having difficulty finding safe seitan for soy allergies, try making your own from wheat flour using this technique. You may also be able to find soy-free textured vegetable protein. But read labels carefully, as the vast majority are made from soy.
Replacing flour for a wheat allergy or for celiac disease will require more than one flour, as there isn't a simple one-to-one substitute for all-purpose flour (or for other wheat flours, like whole wheat flour, cake flour, or pastry flour). You can learn about the properties of different flour in Using Wheat-Free Flours. Also available on the market are blends of wheat-free and gluten-free flours. Bob's Red Mill, Authentic Foods, and Glutano are among the manufacturers whose blended flours are available in some larger supermarkets.
If you're avoiding eggs, you can still use many dried pastas, which are made from semolina and water. Flat pastas, like spaghetti and fettucine, are most likely to be egg-free. Do be sure to ask about fresh pasta at restaurants, as they are more likely to be made with eggs.
Wheat- and gluten-free pasta is starting to become more widely available. The major options are rice pastas, corn and corn/quinoa blend pastas, bean pastas, and pastas made from many grains, with rice pastas being the most common. All have slightly different textures and tastes, so this is mostly a matter of preference and dietary need. Manufacturers producing wheat- and gluten-free pasta include Tinkyada, Lundberg, Bionaturae, Glutino, and Ancient Harvest.