That's why I always get a kick out of people who think that a Galaxy class from Trek could win against a Star Destroyer.
The energy scale alone is massively in the favor of the SD, just in raw output. Not to mention the tactical advantages of sheer weight of fire (rapid fire turbo lasers, point defense turrets, and missiles), the fact that most SDs double as carriers and troop transports meaning the Galaxy class would have to deal with TIE wings and boarding actions, and the slower firing phasers and lack of any meaningful point defense systems would leave them sitting ducks. And as we saw in DS9 with the Breen energy weapons, Star Trek ships are vulnerable to ion cannon like weapons just as much as the ones in SWs.
Anything short of a Borg Cube or 8472 Dreadnought wouldnt be able to scratch a decently armed SD.