If Srek lives in aland far far away and Darth Vader lives in a galaxy far far away. Does that mean that Shrek and Fionna and the shtupid talking donkey live in the same galaxy as Darth Vader and family, and that Darth Vader could actually blow up the kindom?
Theoretically Darth Vader could blow up any kingdom, it would just take longer to get there. What this really means is that the chance of Darth Vader blowing up Shrek'* kingdom is substantially higher than him blowing up a kingdom in a galaxy that is only far away, or rather close.
You have to remember also, that not only was Darth Vader in a galaxy far far away, it takes place a long time ago. There is no time table stamped on Shrek. For all we know, Shrek could be the last surviving Jedi!