Could a country assimilate another country in a democratic way?
As an example, if the UK and an ex-colony of the UK both agree through a referendum to become a single country, would that possible or would the UN say no?
Short answer: Yes. the example that most closely matches your question being the independant Dominion of Newfoundland holding referendums in 1948 and 1949 to chose between several options. The first vote was inconclusive, but on the second 52% voted to negotiate a merger with Canada.
Texas similarly voted to join the United States.
More recently, the Crimean referendum whereby two regions of the Ukraine voted to rejoin Russia. That vote has been disputed as not being legal by many countries, however those same countries all supported internal votes to break up Yugoslavia, so the opposition is not to such an event in principle, but rather on very fine points of law as to when and how such votes can be made. In Canada there have been similar legal discussions on the process for a possible Quebec seccession for example.
In the US there is the debate as to whether Puerto Rico should be allowed to become a full state - also illustrating that such things need widespread agreement from all parties concerned as in Puerto Rico the desire for full statehood has established by referendum in 2012 where 54% stated their desire to end their current status as a protectorate and 61% who marked their preferred option selected statehood. Any attempt to vote on this in the US congress, however, has died without reaching a vote.
As Michael Broughton already pointed out, it can easily and democratically happen.
Another very prominent (and low-on-conflict) version of that happening was East- and Westgermany.
It all happened 100% democratic, and without any riots or so (some demonstrations took place, but in a scale that you can consider normal for a democratic decision)