You can but the trouble with cast iron is it has A LOT of mass and takes a while to heat up and while doing so the toppings/cheese cook.
When i use one after assembling the pie place the pan on a hot stove burner for 2-3 min then place in oven preferably on a stone or steel. I also kept oven temp around 400deg. The burner gets the pan hot and allows more uniform cooking.
Really good pies can be made in cast iron.