Your own capital was once under Muslim rule for half a millennium, which served as a seat of power for many foreign dynasties. These dynasties had a stronger grip over Northern India than they did over the Indus Region, most of which was semi-independent and autonomous.
It is also difficult to define 'India' and what is 'foreign' to it in the context of the ancient period. You cannot just turn Asia into a supposed people/nation and then claim it wasn't invaded by foreigners until the 17th-18th centuries. For example, South Indian Kingdoms may have been foreign to North Indian lands.
India (in a geographical sense) has oceans to the South, Himalayas to the North, deltas/jungles to the East and a 300-mile long desert which separates most of the Indus from India to the West. So of-course it was very difficult for any invader to get through.
Most invading forces were already worn out fighting resistance in the Indus region to press on any further, a famous example being Alexander, whom despite being backed by the most powerful Indus Kingdom (Taxila) did not have the means or morale to advance into India. Another example being the Mongolians as their blood ran our rivers red and were overturned.
Also yes, it is true that Pakistan has never had any large-scale Empire and that is because there was never a common identity for our ancestors to unite upon. We were mostly split into tribes (Biradaris) and loyalty to the tribe was more important than anything else. We constantly fought among ourselves and even Islam was not able to unite us (until the creation of Pakistan). There were still many renowned Kingdoms that sprung out of the Indus such as Gandhara, Sindh, Shahis, Multan, Madra, and etc... A few Misls managed to unite under the new religion of Sikhism and look how they managed to carve out an Empire.
Kushans were not Chinese and the Indo-Greek States of the Indus Region by that time became increasingly culturally fused to the point that they were no longer considered foreign.
Mauryan Rule over the Indus Valley lasted less than a century before they were booted out, there were many revolts against Mauryan rule; mostly notably in Taxila. Mauryan Empire is the only successful Indian Empire that was able to conquer and tame the Indus region for a relevant amount of time.
That map includes tributary states which is wrong. They never conquered or ruled over the Indus region only managing to gain tribute from weak border states who were dealing with invasions from the West.
This is the more accurate and correct map:
https://upload.wikimedia.org/wikipedia/commons/5/5f/Map_for_Gupta_Empire_and_tributaries.svg
It was not long before these tributary states stop paying tribute
Arab rule over Pakistan was actually quite shorter than what it is portrayed. Natives eventually regained their lands through a series of revolts leading to the famed Soomra and Samma dynasties of Sindh.