The Bajorans were not conquered, they were formally annexed by the Cardassians. That means that the Bajoran government at the time signed an agreement where they willingly became a territory of the Cardassian Union. It was all legal, which is why the Feds didn't get involved: all they had to go on for the "Cardassians conquered us!" stuff were a bunch of rebels who were never part of the Bajoran government in the first place.
er, annexations aren't necessarily voluntary on the part of those annexed, whether there's a treaty or not. Are you really defending the legality of an action based on whether there's a treaty? That sounds like Palpatine in Star Wars: Phantom Menace, who's obsessed with getting a treaty signed to "legitimize" an occupation. An agreement signed under duress isn't a legal agreement.