Loot came into English as an item in a glossary for people going out to India.
The word is Hindi lūṭ, "plunder." Word Histories quotes the 1903 glossary Hobson-Jobson, which traces it to Sanskrit lotra, a form of loptra, from the root lup, "rob" or "plunder." The same glossary adds that luṇṭ, "to rob," may be the better source. Etymonline gives the Sanskrit as loptram or lotram, "booty," and links it to a Proto-Indo-European root meaning "to snatch." That root is also behind English "rip."
The earliest record Word Histories cites is John Stockdale's The Indian Vocabulary of 1788, which lists "Loot: plunder, pillage." That is a glossary entry, not a sentence in use. Etymonline dates the word to 1802 instead, in Charles James's Military Dictionary, which calls it an "Indian term for plunder or pillage." The two dates differ because they rest on different earliest evidence.
For decades it was a colonial word. Word Histories says "loot" stayed a familiar Anglo-Indian term. It then gradually found acceptance in England around the wars of the mid-1800s: the China war of 1841, the Crimean War, and the Indian Mutiny. A noun for the goods taken came first. The verb is recorded in 1821, "looting" in 1842 and "looter" in 1858, according to Etymonline. The earlier Anglo-Indian agent noun was looty.
Slang dictionaries picked it up quickly. John Camden Hotten's 1864 Slang Dictionary defined it as "swag, or plunder" and labeled it Hindoo. Three years later Admiral Smyth's Sailor's Word-Book misattributed it to China.
Later senses wandered. Word Histories finds "loot" meaning money in Scottish service slang by 1943, and meaning wedding presents in an American Life article of 1954. In modern English it covers any ill-gotten gain, and the military accent is mostly gone.