Selling modern weapons to China or Taiwan at this time would not be in the long-range interest of the United States and the rest of the world, a group of specialists warned yesterday shortly before Secretary of State Alexander M. Haig Jr. departed on his first official visit to Peking.

As these warnings were sounded to the House Foreigh Affairs Subcommittee on Asian and Pacific Affairs, a senior Pentagon official, who could not be identified under ground rules of his meeting with reporters, said the Reagan administration will consider any requests China may submit for U.S. weapons.

The official acknowledged that this willingness to consider such requests represents a change from the Carter administration's ban on supplying weapons to China. But he stressed that no decision has been made about actually selling arms to Peking.

Haig's visit to China is the administration's first high-level visit to a communist capital and, although it is being represented as an effort "to clear the air," the discussions are expected to influence heavily future presidential decisions on weaponry for China and Taiwan.

It would be "irresponsible and dangerous" for the United States to sell Taiwan any of the advanced FX warplanes now being promoted, because that island nation "is less threatened by the mainland today than at any time since 1950," Richard Holbrooke, former assistant secretary of state for East Asian and Pacific affairs, told the House committee.

In demanding more lethal weaponry, Taiwan "is following a course that they hope will derail 10 years of dramatic and positive developments in the Sino-American relationship" and thus "undo the work of three American presidents," Holbrooke testified.

Holbrooke noted that the Carter administration had limited itself to offering Peking so-called non-lethal items, such as trucks and warning radar. He said the United States probably will have to move beyond those items, but he did not recommend how far.

Holbrooke warned that offering arms to Peking in hopes of reducing its opposition to selling warplanes to Taiwan will not work and could raise tension in the straits separating the two countries, setting back Sino-American relations in the process.

William J. Perry, the Pentagon's director of weapons development and procurement in the Carter administration, went to China with then defense secretary Harold Brown to assess defense needs and capabilities. Perry told the committee yesterday that China cannot afford to buy modern U.S. weapons or build their equivalent.

Perry recommended that the United States help China build such defensive weapons as Dragon antitank missiles and not sell Peking the finished weapons.

Retired admiral Noel Gayler, a former Pacific commander and director of the National Security Agency, said beefing up Taiwan's air force by selling it more modern planes does not deserve "high military priority at this time."

Gayler said "more important" militarily is improvement of Taiwan's air defense, including better ground control systems for warplanes onhand and more effective antiaircraft missiles.

Harry Harding, an associate political science professor at Stanford University, oopposed selling "any lethal equipment" to China or the advanced Fx fighter plan to Taiwan at this time.

"Relatively young and untested" relationships with China should be consolidated before moving beyond them, Harding said.

". . . Our military relationship with China should be undertaken as part of a carefully considered, long-range strategic plan -- not as a short-term response to difficulties in Soviet-American relations or Sino-American relations," Harding said.