The tragedy of Pakistan is not that it did never got dictators. It did. But they all turned out to be weak, pathetic little men
The dictators, like the politicians solely wanted to rule in the maximum capacity that they can. The Turkish military and Pakistan military have a huge difference. The Turkish military saw themselves as guardians of the kemalist legacy and ideology (to attribute their involvement to Turkish history would be wrong). This job was given to them by their leader and founding father of the nation. Jinnah never gave the Pakistan army any such job, infact he is on record in having told them to stay away from politics.
So first major difference is the wishes of the founding father.
Then comes the second major difference which is ideology. The Turkish army saw themselves guardian of the ideology of kemal and for this they would carve for themselves constitutional roles, most notable of it being the NSC whose rules and procedures are considered as one of the most secret documents in Turkey. So kemalism but Pakistan army sees itself as guardian of the country and the only institution that has order. Indeed during the years of 1952-58 the institution of the army tool great pride in being the only orderly institution in Pakistan and looked at the political mess in disdain and while British military tradition always see the military as free from the chaos of politics (never the less subservient to the politicians) the events of 1945-1958 and the division of the army (which had a profound impact on the growth and formation of the nascent Pakistani army) left political marks on the military.
These two differences are very important since they separate the roles and the mindset of the two armies. Infact I would say that even now, Pakistan army struggles to figure out what model of role should the military have in Pakistan. Driver of economics, sole defense, politics directly, politics indirectly and what ideology to support, Islamic nature, secular nature, a mix of both perhaps. These questions still plague the military on how it perceives its role in Pakistan.
With that when the dictators took the reigns of power, they were protecting no ideology nor were they hunting politicians nor corruptions. Indeed everytime their excuse was always that the country was on the brink and they had saved it whereas there is unanimous opinion amongst political thinkers that the country was not even close to that. Infact the most dangerous situation the country found itself in was in 1972 and during that period we had the politician but they used this excuse and junior officers and the institution truly believed that such was the goal of the dictator. We see this in how they went about their business of rule.
Ayub khan punished nobody and focused solely on bringing single military rule. His hatred for politics, attributed to his military training and later events, made him ban political parties and processions and any form of protest. His 1962 constitution reeks of self-indulgence, something you would not expect from a person that wishes to "save the nation". It was in his era that the wealth was truly accumulated amongst a few families. Ayub had no ideological goal or vision.
Yahya khan realized that the political situation of the country demanded a better framework but he also wanted security for his power. He repeatedly tries to cut any deal with Bhutto or mujib that would see him in power.
Then comes Zia. Zia went 180 and used Islamism as his ideology to secure his rule. At one time both liaqat and ayub, in their respective eras, had both showed disgust for the mullah, where the former declared Islam has no clergy and these posers should not be entertained and the latter showed disgust at the idea of entertaining the mullah and their ridiculous demands, most notable of it was making Friday an off day. Zia came under the same banner of "saving the nation" but, like his predecessors, he had no idea nor interest in doing that, since there was an absence of ideology, a goal. He would go on to implant the Islamic ideology and try to make Islam the central goal of the country however his efforts would only polarize the country since Pakistan, a land of diversity and thought even amongst Islamic thinking was not going to receive strict Islamic doctrines of Saudi, well.
By the time musharraf came to power, it was dejavu all over again. "Saving the nation" but have no clue. Musharraf from day one tried to secure his own personal power, most notable was the creation of PmLQ from IJI party which would contain some of the most corrupt people in the country. Aleem Khan is one example. Such corruption that the people literally hate his name. Another thing is often ignored in the modernist musharraf figure is that he built and brought to power MMA and let me tell you something. When he passed the LFO, it contained within itself the requirement that you needed a graduate degree to contest election. Now amongst the programs mentioned, he specifically mentions madrassas as well which give equivalent degrees. This was done to empower the Islamic parties. The entire JUI-F and MMA literally ran on their madrassah certifications. He could have saved KPK from MMA but he literally helped them get to power and the result was that MMA allowed for swat to fall and supported the Sharia implementation in regions of KPK and FATA. They impeded the military operations as much as they could back then.
All of them were interested in self-rule solely. Lacking ideology and goals, they sought only power. The Pakistani military also needs to carve out what ideological role it sees for itself and what path must it take. Should it go the Indonesian route or Turkish route. Either way they need to decide fast.