Bajor was formally annexed by Cardassia, which meant that the Bajoran Government at the time signed a formal agreement that turned the world over to the Cardassians. It was probably because they were threatened or bribed into it but it was all 100% legal under whatever Galactic Laws the Powers in Trek all agree to. The Feds couldn't interfere willy-nilly like that if it was all legal.
er, "legal agreements" signed under duress are pretty much by definition not legitimate.
putting a gun to some one's head to sign a treaty doesn't make it legal. Not to mention, the Cardassians would STILL have been in violation of whatever interstellar conventions on war crimes there are, as they routinely used slave labor and torture, which would have justified Federation intervention.
There's no proof it wasn't legitimate though. I'm saying it was likely forced or bribed, but still with legal authorization with no one to say otherwise.
And we don't know what the Galactic Laws are about annexed planets. The Romulans and Klingons likely did the same to their conquered planets but no one cared.