Pakistani President Mohammed Zia ul-Haq said yesterday that he now believes the Soviet Union is sincere in pursuing negotiations on the future of Afghanistan but that it would never accept a hostile government in Kabul.

In an interview with Washington Post editors and reporters, the Pakistani leader also said he would never recognize the current government of Babrak Karmal in Afghanistan, arguing that to do so would be to sanction the Soviet invasion of 1979.

Later, in answer to questions about Afghanistan at a news conference, Zia sought to dispel any notion that an early solution to the bloody guerrilla war is imminent.

Zia is one of the few foreign leaders to have held extensive talks with the new Soviet leader, Yuri V. Andropov, and the Pakistani leader said he had no basis for believing Soviet troops would be pulled out of Afghanistan any time soon.

"We have no proof, no indications, no promises. I do not see a quick or a very early solution to the problem," he said.

Zia said Afghanistan was one of the focal points of his talks with President Reagan on Tuesday and that the best U.S. policy toward Afghanistan would be one that supports Pakistan's well-being and stability.

In his session with Post editors, and in a later talk at the National Press Club, Zia stressed Pakistan's critical strategic location near the troubled Persian Gulf but denied that the presence of Pakistani military training units throughout the region represented a commitment to defend Gulf countries.

"The security of the Gulf is the responsibility of the Gulf. We have no responsibility. Pakistan is the backyard of the Gulf and we are jealously guarding this backyard," he told his press club audience.

Asked at The Post about the Pakistani commitment to Saudi Arabia and reports that there are several battalions of Pakistani troops there, Zia said there were no active Pakistani units in Saudi Arabia, only military training and construction units.

Asked to elaborate, he said there were 1,500 from the air force, 3,000 to 4,000 from the army and a "few hundred" from the Pakistani navy. These include two or three engineering construction battalions, he said.

"The role of the Pakistani troops . . . is not to defend the House of Saud. They are there to defend Saudi Arabia," he said in response to a question.

Turning to domestic issues, Zia argued that the picture of his military government as anti-democratic and abusive of human rights is false.

"We have revitalized democracy at the grass-roots level after 16 years," Zia said. He said Pakistan is not yet ready for elections on the national level, however, because of the "geopolitical environment" and because "an election now would not bring a happy result . . . . There are a lot of political parties, but no party has its roots in the people."

Asked when elections might be held, Zia said, as he has in the past, that he hoped within two or three years, "if all goes well."

He questioned why he is criticized for taking actions against political figures who are held to have broken the law. Referring to his refusal to grant clemency to the late prime minister Zulfiqar Ali Bhutto, who was hanged after being found guilty of complicity in the death of a political foe, Zia said: "If a man has defied the law, and if he is in authority, he should have thrice the punishment of an ordinary man."

He said Bhutto's daughter, Benazir, was being held under house arrest because "she is bent on defying the law."

"She is allowed to stay in her comfortable house. She is free to use the telephone. She has three meals a day," Zia said of the Pakistan People's Party activist. "We could let her defy the law and then punish her and make a hero of her. Or we can prevent her from breaking the law."