Example: Q: What you call your country? A: Deutschland Q: Ok, then we'll call it Germany
???
I like 'Navajo: Béésh Bich’ahii Bikéyah ("Metal Cap-wearer Land"), in reference to Stahlhelm-wearing German soldiers.'
This apparently confused the English so much that they called the inhabitants of the Netherlands "Dutch".
It's especially common when the two sides have difficulty communicating: "What do you call yourself?" "Ger man." (Spear man [1]) "... henceforth the lands east of the Rhine shall be known as Germania."
[1] This is only one possible etymology.
My guess for Germany, which certainly seems the weirdest, is that it's a result of that process happening and the name getting fixed at different times for different languages, combined with the region having a rather complicated political history.