What you're asking about here is referred to as the difference between an exonym and an endonym. That is, a place as named by people outside the place, and a place as named by its own people.
You bring up an excellent example most people are familiar with. Deutschland, and Germany. Deutschland is derived from the same root as the word Dutch, and the original meaning seems to be just "the people." So it means basically "our land." Germany, on the other hand, is derived from the Latin Germani, the root of which in Latin itself I'm uncertain, but it was simply how the Romans referred to the people on the east of the Rhine.