Yeah, that did happen.
Star Wars is a behemoth though, there is no denying that. The ST powers, aside from maybe the Dominion or the Borg, can only really hope to hold off an invasion, simply by making it too painful. They probably couldn't meaningfully alter the Empire itself.