There is no gh in Tamil, and no z either. And Mahmood of Ghazni in Tamil history books is known as gajini muhammad, and is popularly remembered as having made repeated incursions into India. It is usual for Tamil speakers to invoke his name by way of banter when a student makes repeated attempts to pas an exam, that's all.mundiya Jii, from what I have been able to find out is that "Ghajini" is the name of one of the main characters in the film. On the net, people have mentioned that "Ghajini" was an emperor who tried several times to succeed and he finally achieved his goal. No one has said where this emperor came from and what his goal was.
At another place someone says that the word should be Ghaznii and that it is an Arabic word and name of a Mughal emperor. We know that there was no such "emperor".
Regarding "Ghaznii" or "Ghaznah", this is indeed a city in Afghanistan from where several important historical figures originate from. I am just guessing now but if Ghajini is "Ghaznii", then it may refer to Mahmood Ghaznavii (Mahmood from Ghaznii/Ghaznah) whom you would no doubt know about.