So basically the war like Dominion War won't effect any major power economy in the galaxy. Both Dominion and Federation can war forever if there is no worm hole that limit their access?
I wouldn't say that at all. No nation can fight a full-out war forever. Even if one conflict lasted for decades, eventually, one side will suffer more losses--if only in lives--than its leaders consider acceptable/feasible for victory and surrender, or both sides will come to a territorial agreement to end prolonged hostilities. That's probably how the Romulan Wars ended, IMO.