If you mean in a frying pan on the stove:Yes, but it's hard. The idea is to cook the tomatoes slowly over low all-around heat with circulating air; a fry pan has directional heat (from the bottom) and it's hard to get the temperature low enough. Covering the pan causes steaming, which means you don't get all those nice Maillard reaction products. If you need to use a fry pan, I'd just go for full-fledged pan-frying thinnish slices in a bit of oil and herbs/spices. It's good, but different from roasting.If you mean in a frying pan in the oven:Yes, of course. It's just a different pan shape; you're still performing the same roasting process.