This pertains only to the ruling dynasties till Mahmud Ghaznavi
Mauryans------------> Till Ashoka Hindu, then Buddhist and then from Dasaratha onwards Hindu
Indo-Greeks---------> Till Menander Ancient Greek religion,then Buddhist
Northern-Sakas------>Hindus
Indo-Parthians--------> Zoroastrians
Kushanas-------------->Till Kadphises,Central Asian Shamanism,then Hindu,Kanishka onwards Buddhist,Vasudeva onwards Hindu
Western Sakas------->Hindu
Hunas------------------>Central Asian Shamanism and then Mihirkula onwards Hindu
Hindu Shahis--------->Hindu
Chach of Alor---------->Hindu
Rai dynasty------------->Buddhist
Karkota dynasty-------->Hindu
This is quite far from accurate and you missed countless other dynasties.
The pre-Achaemenid Kingdoms of Gandhara, Kasmira, Madra, Sindhu, etc... were primarily followers of Vedism.
During Achaemenid rule, who were mostly Zoroastrian, Vedism remained the dominant religion.
The ancient Ror dynasty of Sindh was Buddhist.
The Macedonians introduced Hellenic Polytheism which would have a lasting effect, during this period, the taboo on idols was also broken.
Despite the Mauryan invasion, the widespread religion was still a boiling pot of Vedism, local folk religions and Greek polytheism. In this time, Buddhism also began to spread.
The Greco-Bactrian rule saw the development of Hellenic Buddhism; especially in Gandhara, which would later go on to serve as the seat of Buddhism in the region.
The Indo-Greek Kings, though initially followers of Greek Polytheism, began to convert to Greco-Buddhism. This shift was also seen among the populace. It is under their reign that Buddhism becomes to dominant religion in the Indus Region.
The Sakas began to adopt Greco-Buddhism as soon as they migrated and largely integrated into the native culture.
The following Kushans were primarily Buddhist and it is under their reign that Buddhism reaches it's prime in modern-day Pakistan, spreading like wild-fire from it's source in Gandhara to Central Asia and onwards to China and the Far East.
The Indo-Sassanians retained Zoroastrianism as their religion, though the majority of the population still followed Buddhism.
The Rai Empire of Sindh was Buddhist.
There is uncertainty over what religion the Alchon Kings followed, we know that out of their rulers; Mihirakula and Gokarna may have been followers of Shivaism. This era saw the decline of Buddhism. The invasion would leave Kashmir under Hindu rule, with occasional Buddhist rulers and chiefs. This would end when Raja Rinchan, a Buddhist King would rebel and reunite Kashmir under Buddhist rule. He would also eventually convert to Islam; becoming the first Muslim King of Kashmir.
The following Nezaks were primarily Buddhist/Zoroastrian.
The Kabul Shahis of Kabul Valley and Gandhara were Buddhist, however their last ruler was deposed by a Brahmin minister.
The Chach dynasty of Sindh arose after a Brahmin minister deposed the Buddhist King through conspiracy, this dynasty faced significant resistance from the majority Buddhist population and it was no surprise when the natives joined Muhammad Bin Qasim's army in droves in an effort to topple the usurpers.
The Kingdom of Taank primarily followed Punjabi folk religions.
There are many other dynasties I can talk of, but I hope you get the picture.