The new Soviet leader, Mikhail Gorbachev, has issued Moscow's sternest warning to date to Pakistan for its support of Afghan rebels, and well-informed circles here reported today that the Kremlin was considering unspecified actions against Pakistan if President Reagan continues his military pressure on Nicaragua.

Signals that Moscow considers linking the question of Nicaragua to Pakistan's policy toward Afghanistan appeared designed to give a new twist to both problems. It was not clear whether these signals hold any prospects of possible trade-offs, although they suggest that the new Soviet leader seems determined to seek a solution of the Afghan issue.

Gorbachev's warning came yesterday during his meeting with Pakistani President Mohammed Zia ul-Haq and Foreign Minister Sahabzada Yaqub Khan, who were here for the funeral of Konstantin Chernenko.

A report on the meeting by the official news agency Tass included extraordinarily harsh language. It said that Gorbachev and Soviet Foreign Minister Andrei Gromyko gave the Pakistani leaders "a frank, principled assessment of the policy conducted" by Zia's government.

"Aggressive actions" against Afghanistan, a Soviet ally whose government is maintained by about 100,000 Soviet troops, are being carried out from Pakistan's territory, the Tass report continued. "It was also stressed that this cannot but affect in the most negative way Soviet-Pakistani relations."

The new Soviet leader appeared to be taking an entirely new and tougher approach toward the Afghanistan issue. Charges that Zia was supporting "aggression" against a Soviet ally and warnings of possible dire consequences of his actions have been voiced in the Soviet media on several occasions. However, Gorbachev took the unusual step of associating himself with these charges during his meeting with the Pakistani leader yesterday.

Sources here hinted today that the intensified pressure on Zia was linked not only to Moscow's growing frustration with the five-year-old military stalemate in Afghanistan but also to Reagan's increased pressure on the leftist government of Nicaragua.

According to these reports, the Russians are considering the possibility of encouraging anti-Zia elements in Pakistan, presumably by providing arms and other assistance to separatists in border areas such as Baluchistan.

The sources here suggested that an American military action against Nicaragua would provoke a serious effort to topple the Zia government.

On Wednesday, Gorbachev received Nicaraguan President Daniel Ortega, and Tass reported that they "vigorously condemned the U.S. policy of interference in Latin American affairs" and agreed on the need to "sharpen international efforts . . . for a just political settlement."

Diplomatic observers here noted that by linking the problem of Afghan insurgency to America's pressure on Nicaragua, the new leadership seemed to be signaling that it is capable of inflicting real damage on U.S. interests in an area close to Soviet borders.

Washington has longstanding ties with Pakistan dating from the CENTO alliance of the 1950s and is currently supplying Zia's government with advanced combat jets and other weapons under a $3.2 billion aid package concluded after the Soviet invasion of Afghanistan.

U.S. sources here said that for nearly a year there have been cross-border raids from Afghanistan into Pakistan as well as artillery shelling of Pakistani positions from Afghan territory.

There is little doubt that Gorbachev would like to find a way out of the Afghan impasse. The Soviet invasion of Afghanistan has complicated Moscow's relations with China, the Moslem countries and the West. The Afghan war is also becoming increasingly unpopular in the Soviet Union, although discontent is rarely voiced in public.

An earlier article in Pravda, the Soviet Communist Party newspaper, included more explicit charges against Zia's regime and asserted that the CIA was maintaining a "number" of bases and camps in Pakistan to train and equip Moslem insurgents who are subsequently sent into Afghanistan.

Pravda also said that "American instructors" are training Zia's police forces to be "used in the restless North West Frontier Province of Pakistan." This border province, which has become a logistical base for the Afghan rebels, includes an area where ethnic separatists, traditionally supported by successive governments in Kabul, have sought to establish an independent state called Pushtunistan.

Pravda also charged that all weapons destined for use by the Afghan rebels are passing through the Pakistani port of Karachi.

The Gorbachev-Zia meeting appears to have brought Soviet-Pakistani relations to a new low.

Zia was here for the third time in less than 2 1/2 years. In November 1982, when he attended Leonid Brezhnev's funeral, Zia was received by incoming leader Yuri Andropov, who gave him a warm welcome and sought to enlist his support for a political settlement on Afghanistan.

Andropov's proposal sought to end all insurgent activity from Pakistan's territory before diplomatic talks on an eventual withdrawal of Soviet troops. This initiative came to naught and the Afghan problem has remained stalemated diplomatically as well as militarily.

Zia came to Moscow again in February 1984 for the funeral of Andropov and remained in the city an extra day hoping to meet Chernenko. However, Zia was given a cold shoulder and left without seeing the new Soviet leader.

This time, Zia was among more than 25 foreign dignitaries received by Gorbachev. The new Soviet leader's words in his meeting with Zia, as summarized by Tass, stood in stark contrast to the overall conciliatory and friendly tone of Gorbachev's discussions with all other visiting politicians.

In Islamabad, Zia told a news conference that he held two "business-like" meetings with Gorbachev and that Afghanistan, "as expected, figured largely" in the talks, the Associated Press reported.

Despite "obvious differences of perception," Zia said, " . . . both sides seem to be aware that the problem does not admit of a military solution."

Gorbachev also met yesterday with Afghanistan's Communist president, Babrak Karmal, and they jointly condemned "continued aggressive actions by outside forces" against Afghanistan, according to Tass. The news agency provided no other details on the substance of the talks.

The Kremlin sent troops into Afghanistan in December 1979 to back up Babrak after the leader ofthe ouster of rival Communist faction leader Hafizullah Amin was ousted.