More generally, is a nation allowed to cede territory to another nation, contrary to the wish of the (majority of) inhabitants living in that territory?
Allowed? The government makes the rules. Therefore, the government is allowed to do whatever it pleases. Some governments claim to be more democratic than others and, therefore, make efforts to at least appear to be accommodating to the people. Even then, sometimes governments are taken to court by the people because the governments actions may have been illegal. Sometimes the people even win.
On a local level this is called the right of imminent domain. The government can condemn a home, evict the owners (force them to move) and then use that property for another purpose.
Of course, international law is entirely different. Did the Cardassians have the legal authority to occupy Bajor? That's a joke. International treaties are definitely not beholden to the will of the citizens.
The number of Maquis seems insignificant compared to the total number of Federation (or Cardassian) citizens. They are definitely much less than 1%. There is no situation where one government will choose to continue armed conflict because less than 1 tenth of 1% of the citizens are not happy with the results of a peace treaty.
On an international scale governments are sovereign and will do as they please. They are the sole authority over where borders are drawn. The citizens opinions are ultimately irrelevant. As an African proverb says; "when elephants fight, even the grass gets trampled".
See Florida colonization, the Republic of Texas, the Confederate States of America, Indian Wars, Trail of Tears, Berlin Wall, Vietnam Conflict, Korean Conflict