Yep! Fascinatingly enough, the monarchy of Portugal not only relocated to Brazil in 1807 (fleeing the armies of the putative Anti-Christ, better known as Napoleon Bonaparte I), but after Portugal was retaken the "mother country" was actually ruled from Rio for over a decade!
http://en.wikipedia.org/wiki/Transfer_of_the_Portuguese_Court_to_Brazil
Of course...for example Maximilian I of Austria became the king of Mexico and Pedro I moved from Portugal to Brazil for the same reason.