Because microwave will automatically reflect when it meets metal objects, the metal parts around the microwave oven (such as the shell) can effectively resist microwave radiation in the microwave oven.
But the purpose of using microwave oven is to heat food. If the container for heating food is metal, it will hinder microwave heating food, so you can't use metal containers for food.