It's hard to clean the baking sheet from the stains left by baking food. I was wondering if it is safe to bake the food wrapped in aluminum foil, or whether some aluminum may be leached into the food?
Some foods dissolve aluminum foil. From experience, one food that does this is cured ham. Food Safety Education says:
It is possible for heavy concentrations of salt, vinegar or some other acidic compound, or highly spiced foods to cause the foil to disintegrate. The product of either of these reactions is an aluminum salt. It does not harm the food but you will want to scrape any deposit off the food as it may impart an undesired flavor and color.
If this happens when you're counting on the foil to seal in moisture, it could ruin the meal.
Personally I usually use baking paper rather than aluminium foil, for two main reasons:
Aluminium foil, being extremely thin, tends to tear easily. It doesn't take much to poke a hole through it, and then its planned use, to keep the baking tray clean, fails because oil or other stuff will ooze through the hole(s). Meat in particular is likely to have sharp edges which will pierce the foil.
In the case of bread, the foil can cling to the cooked food. In the past I recall peeling of bits of foil, piece by piece, as some sticks and some doesn't. This doesn't happen with baking paper which is somewhat stronger. If you miss a piece of foil your bread can have a rather unpleasant "crunchy" taste as your teeth encounter small bits of foil.
I was wondering if it is safe to bake the food wrapped in aluminum foil ...
I don't know about "safe" or not, but rather I think that the baking paper is more practical, and achieves the same effect, if a clean tray is what you are after. Similarly, lining a cake tray with paper can make cleaning it easier.