It’s perfectly safe to cook a steak in the oven with foil. You might want to use some parchment paper on top of the foil before wrapping the packet if you’re worried about the aluminum affecting the taste of your meat.