Hello secularism a very broad topic and there are many factors which may lead to it but since the to nation theory is also being discussed here so i first would comment on it.
First The Two Nation theory was not given by a mullah or a religious leader it was given by a normal man who was rather concerned with the state of Muslims than Islam and the reason was the state of common Muslims was miserable after the fall of Mughals and subsequent war of 1857 Muslims in general become very poor financially uneducated and had very less political power they left the British education as mullahs gave fatwas that British education was Haram.On the other hand the Hindus embraced education took British bureaucracy jobs had political power and British were happy with them too.
But Muslims were disillusioned that they will seize power again without being the part of system.It was therefore that Sir Syed realized that if someday the subcontinent became Independent there would be no one to protect the rights of Muslims and being a minority it was no way they could do so in united India.
Therefore he Advocated "British education" along with the Two Nation theory.The two nation theory was one of his ideas and not all of his ideas hence with his efforts despite of being labeled as a Kafir(Infidel) by mullahs of that time he was very successful and that of course was his biggest achievement and many of the people who latter joined AIML were educated in his Aligarh College.The two nation theory was one of the reason of AIML's popularity and subsequent success but was NOT the sole cause of Creation of Pakistan.
Pakistan was made by Jinnah who once said" I am an Indian first and Indian last" and was once biggest advocate of Hindu Muslim unity.But different reasons and the attitude of Nehru and Congress changed the course of things and views of Jinnah.
There were many events which led to this some of these were the Shud-Dhi movement by Aria Samaj (the campaign to forcibly convert Muslims to Hindus), Gandhi's statement urging Muslims to leave India and to migrate to Afghanistan during the Khilafat movement,Nehru Report,The use and advocacy of Hindi and instead of Urdu Jinnah's protest and Gandhi's reply"Urdu is a Quranic Language",Congress's treatment of Muslims when it came to power a nearly decade before Independence etc there are many other event too which led to separation.
So its not only the two Nation Theory that created Pakistan.
On topic Pakistan can be secular if present state of affairs continues the growing sectarianism which is effecting people no one is safe from it people are growing impatient over this and the people advocating secularism(actually rather questioning the absolute authority of religious mullahs) they have become more vocal and their numbers have grown significantly and so has their following.
And Pakistan has always been a society of diverse view actually its founders were all secular people who were opposed by the very mullahs who sided with Congress be it the Mujlis-e-Ahrar or Moududi Jamiat or Ulema-e-Hind all opposed Pakistan and even called Jinnah Infidel,and Pakistan, "NaPakistan" even the one Ahrar leader commented on the fall of Dhaka "Thank God we were not involved in the sin of making Pakistan" so the people who know these facts wonder how on earth these kind of mullahs decide that how this country and its constitution and dealing with the citizens should be. So its quite possible in future that Pakistan would may become a secular state.