Turkeys are native to North America, so it's something of an etymological puzzle that they've come to have the same name as a Eurasian nation. Indeed, it appears that the use of the term "turkey" for poultry was the result, mainly, of European explorers' confusing it with another bird:
This is a guinea fowl. It's in the same taxonomic family as turkeys and chickens (Galliformes) but it's native to sub-Saharan Africa. As Stanford linguist Dan Jurafsky explains, they were reintroduced to Europe in the 15th century: "Collecting exotic animals was a hobby of Renaissance princes and the wealthy, and guinea fowl appeared in their royal parks and private menageries."
The Mamluk Sultanate, which controlled Egypt and modern-day Israel and Lebanon at this point, served as a supplier. The Mamluks were ethnically Turkish (most were from the Caucasus), and the birds became known as "galinias turcicas" or "Turkish chickens." They also were sometimes known as "Indian chickens," as guinea fowl often were imported from near modern-day Ethiopia, which at the time Europeans often confused with India. Then, as trans-Atlantic trade developed in the 16th century, North American turkeys were confused with guinea fowl.
Consequently, "the English word 'turkey cock' or 'cocks of Inde,' and the French word 'poules d'Inde,'" Jurafsky writes, "were used sometimes for turkeys, sometimes for guinea fowl, for the next hundred years." For example, a character in Shakespeare's Henry IV: Part I refers to a "turkey," which historically must have been a guinea fowl (Englishmen did not know about the North American bird during Henry IV's reign). But over time "turkey" came to be exclusively associated with the American bird.
Sources other than Jurafsky tell a slightly different version of the story. Columbia Romance Languages professor Mario Pei told NPR's Robert Krulwich that the association with Turks comes from guinea fowl being traded through Constantinople, and does not mention the Mamluks at all. Gretchen McCulloch at Slate came to a similar conclusion.
The fact that Constantinople wasn't under Turkish control until the mid-15th century might make this version less plausible than the Mamluk origin story. But the broad parameters — Turkish or Turkish-in-origin traders sold guinea fowl to Europeans who then got confused and started calling North American birds turkey — are consistent in both the Mamluk and Constantinople versions.
Turkey, for its part, does not use the term "turkey" at all. Instead the birds are equally perplexingly known as "hindi." McCulloch unravels that mystery here.