You can, however I recommend sticking with a casserole dish if you have the option. The tomatoes will begin to soften as then bake which causes some of the tomato juice to spill out. This is why having higher edges on your pan is a good idea to avoid any spills!