The Imperial State of Iran was the first country to formally recognize Pakistan's independence in 1947.
While other entities might have engaged in preliminary discussions or shown tacit approval, Iran was the first to extend official recognition to the newly formed nation. This recognition established a foundation for diplomatic relations and future cooperation between the two countries. It's important to distinguish between informal contacts and official state recognition. While Israel, through Ben-Gurion, attempted to establish diplomatic relations soon after Pakistan's formation, these efforts were not reciprocated by Jinnah.
Therefore, the definitive answer to the question remains: the Imperial State of Iran holds the distinction of being the first country to officially accept Pakistan.