The Caramelldansen is an internet meme similar to the Caipirinha Dance, Paffendorf Dance and Pappara Dance. This is one of the most popular internet meme related to music and dancing, with the others are the Rick Roll and Caipirinha Dance.
According to Ruakuu's blog, the origin of Caramelldansen was the flash loop composed by Sven from Sweden at 23rd Japan Gold Disc Award.
In the Disney cartoon "Phineas and Ferb" at one point in the series, they travel to Japan and notice people are dancing similar to those in the video Caramelldansen. However, this memes origin is Sweden, not Japan.