Because of the name of the popular pastry, the Danish is frequently assumed to originate in Denmark. In fact, the Danish actually originated from Austria. So why isn't the "Danish" called the "Austrian" instead?
In 1850, bakers in Denmark went on strike over wages, so the bakery owners were forced to hire foreign workers who specialize in baking, particularly Austrian Bakers. The Austrian Bakers were unfamiliar with Danish baking methods, so instead they baked their classic pastries from Austria to the public.
The Pastries the Austrians baked quickly became popular among the Danish people. Even when the Bakers' strike ended there was a massive demand for Austrian Pastries. It was because of the pastry's massive popularity in Denmark that it was called the "Danish."
Today, the Danish remains one of the most popular goods sold at Bakeries. In Denmark, the word for pastry is "wienerbrød," or "Viennese Bread."