Of course, at home in the kitchen we all make substitutions with recipes all the time. Maybe you don't have the exact ingredient called for in a recipe, so you use something else in its place. Maybe you modify a recipe to suit your own preferences, taking out a food you don't like, and adding one that you do. Maybe you sub a recipe's ingredients in order to make it fit with your personal dietary ethics (as is often the case with vegetarians and vegans), or to improve its nutritional profile. Maybe you simply want to modify a recipe in order to "make it your own." Or maybe you take a "standard" recipe, and substitute ingredients in order to make it fit with dietary restrictions (such as gluten, dairy, peanuts, whatever...). These are all good and valid reasons to make substitutions in a dish.
When making substitutions, however, it's important to have realistic expectations. Not all substitutions are created equal. Depending on what type of food you're making, and what ingredient(s) you're substituting, it can be a non-trivial thing. This is especially true in baking. Sub-ing ingredients in and out of a baking recipe is not nearly as simple and straightforward as swapping a glass of soy milk for a glass of cow's milk. Baking is a science, genuinely. Every ingredient is in a recipe for a reason. It has certain properties and performs certain functions, and oftentimes, substitutes just don't get it done. (At least, not easily and not without other major modifications.)
Here's a case in point: Some time after posting my finalized recipe for gluten-free sandwich bread, I received a personal email from a reader to this effect - "I tried your recipe and it didn't work for me. Oh, and by the way, I substituted soy milk for cow's milk, Earth Balance for real butter, and Ener-G Egg Replacer for the egg whites." Well, no wonder problems arose! In truth, this person didn't make my recipe, and my recipe didn't fail. They made a heavily modified version of the recipe, with significant and crucial substitutions.
Consider the eggs. I used eggs whites in my bread recipe for a very specific reason. Egg whites are comprised almost exclusively of protein. In particular, they contain a brand of proteins known as albumins, which are what enable you to whip egg whites into stiff peaks. In baking, those same albumin proteins - in concert with xanthan gum - can help to more closely mimic gluten, resulting in the sandwich bread I was so proud of. Now, consider Ener-G Egg Replacer. It is made mostly from potato starch and tapioca starch. Nutritionally, it is almost exclusively carbohydrate. In other words, although it is called "egg replacer," when it comes to baking and the role of eggs in sandwich bread, Ener-G Egg Replacer does nothing of the sort. It is all carbs. Egg whites are all protein. The egg replacer contains none of the desirable albumin proteins.
I'm not saying you shouldn't bake without eggs, or shouldn't use "replacement" products as you see fit, or shouldn't substitute in recipes. Quite the contrary. But when you do, first take a step back and ask yourself some important questions: Why is an ingredient in the recipe? What role does it play? When it comes to gluten, we tend to be more familiar with the answer - gluten is what makes dough "doughy." It makes dough elastic and stretchy, and enables it to retain gas bubbles when dough rises and bakes.
When it comes to dairy, egg and other substitutions, the waters may get a little murkier. Even if the answer isn't obvious, it's helpful to think about these sorts of things, and to adjust expectations accordingly. And remember: if a recipe doesn't work out quite according to plan after you've made some substitutions, don't be discouraged. There's almost certainly a solution out there, even if you haven't found it or figured it out just yet.