I got this from Wiki:
The Maastricht Treaty (formally, the Treaty on European Union or TEU) undertaken to integrate Europe was signed on 7 February 1992 by the members of the European Community in Maastricht, Netherlands. On 9–10 December 1991, the same city hosted the European Council which drafted the treaty.
Later:
The process of ratifying the treaty was fraught with difficulties in three states. In Denmark, the first Danish Maastricht Treaty referendum was held on 2 June 1992 but a shortfall of fewer than 50,000 votes resulted in the treaty not being ratified.[7] After the failure, alterations were made to the treaty through the addition of the Edinburgh Agreement which lists four Danish exceptions. The treaty was eventually ratified the following year on 18 May 1993 after a second referendum was held in Denmark,[8] with legal effect after the formally granted royal assent on 9 June 1993
so it seems the Danes changed their minds.
It appears the Lisbon treaty was eventually accepted in Ireland. The Irish are now, at any rate, overwhelming pro-EU.
Like us here in the UK, any country can have a referendum and leave the EU if the majority want it.