It depends on what you mine. If you are mining precious metals (the most profitable thing to do) then you sell them at a station where the demand is high. Precious metals command a good price everywhere, but you need to look for an economy that pays th emost for them. AFAIK, that is everywhere except extraction/refinery type economies, because they produce the stuff themselves.
I've always found that agri/industrial/high tech stations pay th emost for precious metals. By that I mean, silver, gold, platinum and palladium. The "industrial" metals are just not worth as much.
On th eothe rhand, if you end up mining minerals then a refinery pays for those, because they refine them. However, if it's a refinery/extraction combo, they pay less...they do their own extracting. But some minerals can still pay off, because they might not have their own reserves of them there.