mahmood ghaznavi a looter?

Present day Afghanistan consists of many ethnicities, including Pashtuns, Uzbeks, Tajiks and Hazaras. They are all called Afghans.
But historically, and during Mahmud's time, the term "Afghan" was used in Person to refer only to Pashtuns.
So it would be historically incorrect to call Turkish speaking Turk Mahmud an Afghan. Mahmud was not Pashtun/Afghan.