Is this an conventional oven or a microwave oven?
If it's a conventional electric oven, there's no problem doing what you like to do. Just don't do strange things with foil like wrapping it around the heating elements. :crazy:
But if it's a microwave, then no, you can't wrap your food in foil. That will block the "power" from getting to it. And it could cause sparking inside the oven. :eek: HOWEVER, in a microwave oven you can do the same thing with parchment paper or waxed paper that you would do with foil in a conventional oven. Just remember that you'll have to adjust the cooking time. (Was there a recipe booklet or cooking instruction booklet with the oven? That will give you some help on timing.)
BTW: the method of cooking food wrapped in packets of paper or foil is called "en papillote" (that's French). It's a great way to keep juices with the food, not running out into a pan and drying.
And another BTW: Welcome to ChefTalk, Martin! Do stop by the "Welcome Forum" and introduce yourself. :D