How did the two scandinavian kingdoms at the time (Denmark-Norway and Sweden) avoid civil war or breakup during their conversion from Catholicism to Protestantism? What allowed such a relatively smooth transition (when compared to France and Germany)?
Well, long story short, they didn't. The process was definitely more peaceful than in other areas, but it still had its hiccups. I'll try to explain both the reasons and the exceptions. My answer will mostly concern Sweden (and with it Finland), so I hope someone can add to it.
A little background: As you probably know, Denmark, Norway and Sweden were all "united" in the Kalmar Union starting from 1397, when Eric of Pomerania was declared the king of all three countries (which he'd received through inheritance and war). I say "united", because there were several long lapses where Sweden rebelled or otherwise broke off. The last time this happened for good was in 1523, when Gustav Vasa secured Sweden's independence and became its king.
However, he was now deep in debt to the Hanseatic city of Lübeck, which had supported Sweden's rebellion, and forced to grant Hanseatic merchants extensive privileges. To pay his debts, he needed money. In addition, the Pope had denied his requests for a new archbishop to replace the previous, Gustav Trolle, who was a Danish loyalist, so he had another reason to try and reduce the Pope's authority.
In many other areas, the Reformation began "from the bottom up", that is to say, it was a popular movement - often a violent one - before becoming officially accepted, sometimes reluctantly. In Sweden, however, it was "from the top down". Lutheranism was still a very recent concept when the Diet of Västerås made Gustav Vasa the head of the Church of Sweden in 1527, on his own initiative - compare the rise of Anglicanism a few years later, also led by the king of England but with more extensive involvement from others. Gustav Vasa was very respected and the Diet recognized the need for sacrifices, willing to throw one of four estates under the bus so to speak. This gave Gustav the ability to appoint his preferred archbishop, and perhaps more importantly, confiscate a great deal of the Church's wealth and land to pay his debts and strengthen the crown. The Church was relatively poor to begin with, compared to its southern equivalents, and couldn't really fight back. These changes were very sudden, though the actual dogma was reformed more gradually.
Why did this go so smoothly? Well, the Vatican was already quite distant - both geographically and culturally - so there was little resistance from that direction. Though the confiscations definitely hurt, the Church of Sweden was already quite "Lutheran" in terms of simplicity and modesty, so that transition wasn't too sharp either. In addition, there was already a great deal of syncretism with pagan traditions (especially in Finland), so Catholic dogma wasn't very strict to begin with.
On the other hand, it didn't - go that smoothly, I mean. There were many uprisings in the next few decades, most famously the Dacke War in 1542-43 in Småland, a wealthy part of southern Sweden. It was motivated largely by the confiscation of church wealth and the forced institution of this new religion. It involved mostly peasants, led by Nils Dacke, but was also supported by the local clergy, and was eventually defeated by violent military intervention and embargoes. Similarly, the 1590's saw a great deal of power struggle and open war between Gustav's Catholic grandson Sigismund, who was also king of Poland, and the Swedish nobles who were afraid that he'd try to bring back the Papist faith (and reinforce Polish influence). In Finland these struggles manifested as the Cudgel War of 1596-97, another large peasant rebellion, though it itself wasn't directly motivated by religion. Eventually Sigismund was forced to give up the Swedish throne to his Lutheran uncle.
As a side note, Queen Christina converted to Catholicism in 1654, abdicated and was forced into exile, though she left quite willingly.
So, Sweden had several rebellions and power struggles related to its adoption of Lutheranism. Meanwhile in Denmark the Reformation was actually the result of a civil war, namely the Count's War in 1534-36. Christian III arguably "imitated" Gustav Vasa, as his interest in Lutheranism was largely a play for power and money as well, and definitely controversial.
All in all, both Sweden and Denmark-Norway definitely had a lot of internal problems in the aftermath of their sudden conversions. The biggest reasons that they didn't get quite as bloody and lengthy as in some other places were mainly: the church's preexisting weakness and distance, continued support from the crown, disinterest from and towards the international community, sparse and rural population structure, and the lack of strong religious divisions along lines of class, culture or geography.
Sorry if this was a little rambling. I'd be happy to clarify if something was unclear.