Not true, although Pakistanis here like to believe so. During his rule, Isloo itself was threatened by the likes of the red mosque wallahs and the chics with sticks. Mushy had to do a full fledged military operation with special forces, right in the federal capital. Granted, he put an end to those terrorists, but the fact that they flourished for so long right under his nose is not a good record for peace and stability.
Pakistan's problems with religious extremism run a lot deeper than simply who is in power. It is the easiest thing to do, to attribute blame to the politician or party one doesn't support, or praise the ones you do. So here in these threads you see Imran Khan supporters blaming Nawaz, or vice versa. Or some praising Mushy, some blaming him and saying that it ll started when he decided to join the WoT. But the brutal fact is that one person at the top is neither the problem nor the solution. This just had to happen, after a big chunk of the population was radicalized in the 80s during Zia's rule, ith Saudi money and ideology. After raising an entire generation to hate, electing the right politician or bringing a dictatorship is not going to solve the issue.
The current and future generations will have to be deradicalized - and by that I mean taught to value life and humanity and rationality. The influence of religion will have to give way to the enlightenment. As long as there is a large mass of illierate, religiously motivated population, somebody or other, foreign or homegrown, will use them as cannon fodder in power struggles. The only long term solution is complete deradicalization and education. The only short term solution is targetted killing of terrorist leaders, and systematic dismantling of terrorist infrastructure.
Stop looking for messiahs (whether IK or Mushy) to deliver the nation from evil.