India and Pakistan agreed today to begin official discussions here in December on long-dormant proposals for a nonaggression treaty.

Meeting for the first time on Subcontinent soil, Pakistani President Mohammed Zia ul-Haq and Indian Prime Minister Indira Gandhi appeared to have given significant impetus to the sluggish dialogue on improving Indian-Pakistani relations, although both sides acknowledged that there was no breakthrough in substantive issues that have prompted three wars and a hectic arms race between the neighbors.

After two hours of talks with Gandhi during a stopover on his way to Indonesia and Malaysia, Zia was almost effusive about what he termed the "heart-to-heart exchange." He told reporters "it couldn't be better" and added, "I think, God willing, that it will pave the way to better relations between Pakistan and India."

"It is not possible to resolve all problems at such a brief meeting, but it will be a success if doubts and suspicions between the two countries can be removed," Zia said.

Gandhi characterized the talks only as "cordial."

The two leaders had met in 1980 in Salisbury during a celebration of Zimbabwe's independence and in Belgrade after the death of Marshal Tito, but it was the first encounter in the region and the first time since 1972 that a Pakistani president visited India as the guest of the prime minister.

In a communique, the two leaders agreed to establish a joint commission to improve relations, particularly in economic and cultural exchanges, and to hold subministerial-level discussions here in December on a Pakistani draft of a no-war pact and an Indian draft of a "treaty of peace, friendship and cooperation."

Gandhi and Zia also said they looked forward to continuing their dialogue at the summit meeting of the nonaligned movement, scheduled to be held here in March.

Zia arrived to a relatively low-key welcoming ceremony at New Delhi's international airport. After a handshake with Gandhi, he was driven away to a meeting with Indian President Zail Singh, at which he was reported to have said that India and Pakistan can now "lay the foundation for a new era of friendship."

Following that meeting, he met privately with Gandhi for an hour and held further discussions with her during a luncheon.

When asked about the lack of honor guard or other trappings of a visit by a head of state, an Indian foreign ministry official replied, "It is not an official visit or a state visit. It is a stopover."

Several senior Pakistani officials, including Foreign Secretary Niaz A. Naik, stayed here after Zia's departure for talks with Indian officials.

A "no-war" pact was first offered by Pakistan in September 1981 and formally delivered to the Indian government by Pakistan when foreign ministers of the two countries met here last January. A draft of India's friendship treaty was given to the Pakistanis in August.

Details of the drafts have not been made public, but the 14-point Indian proposal reportedly requires Pakistan to remain within the confines of bilateralism to solve all outstanding disputes, including contested territory in Kashmir, and to make a formal commitment not to lend bases or military facilities to a third country.

Both conditions are reported to be unacceptable to Pakistan, and the nonaggression dialogue subsequently stalled without any official discussions being held.

Pakistani and Indian officials said Gandhi and Zia also discussed "regional and global issues," although they refused to say if the question of Soviet intervention in Afghanistan was a topic. Pakistan has openly criticized the Soviet invasion of Afghanistan, while India's reaction has been subdued because of its special relationship with the Soviet Union.

Gandhi was noncommittal about whether she had complied with a request of supporters of Nusrat Bhutto, widow of the executed former Pakistani prime minister, to ask Zia to allow Mrs. Bhutto to travel abroad for medical treatment. She reportedly suffers from cancer. When asked whether she had pressed Zia to grant the travel permit, Gandhi told reporters, "The doctors are examining this case."