Vice Premier Teng Hsiao-ping yesterday confirmed that China has moved troops to its border with Vietnam, and suggested it might be necessary to teach the Vietnamese "some necessary lessons."

Teng's statement at a luncheon meeting with reporters on his final day in Washington before embarking on a four-day national tour was the strongest hint so far that China might use its newly augmented force of 10 to 12 divisions and close to 150 warplanes in the border region against the Hanoi regime.

U.S. officials are deeply concerned about the possibility that war in Asia could spread from the Vietnam-Cambodia clash in Indochina to involve Chinese forces directly and perhaps even the Soviet Union in retaliation.In recent days the United States repeatedly has advised the Soviet Union, China and Vietnam against widening the already-dangerous Indochina conflict.

Confirming that there have been "necessary troop movements" of Chinese forces, Teng said "we will have to wait and see" what action might be taken. He emphasized that the Chinese "mean what we say" and that they "do not act rashly."

He added that "it just won't do" not to teach "some necessary lessons" to such international forces as the Cubans and the Vietnamese. He called the latter "the Cubans of the Orient." He charged that Cubans are "running rampant" in Africa and that Vietnamese will do even worse in Asia unless restrained.

In addition to the hard talk against the Soviet Union and its allies, Teng's final day in Washington included a White House ceremony for the signing of science and technology, cultural and consular agreements, and a warm public send-off from President Carter.

"We have charted a new and irreversible course toward a firmer, more constructive and more hopeful relationship," Carter said. While saying that Washington and Peking "share many common perspectives," he was careful to add, perhaps with an eye to the Soviets, that, "The security concerns of the United States do not coincide completely with those of China, nor does China share our responsibilities."

Backed by the red-starred People's Republic of China flag and the Stars and Stripes at a table beside Teng, Carter announced to some 240 guests that U.S. consulates will open soon in Shanghai and Canton, and that the Chinese will establish consulates in Houston and San Francisco.

Carter also reported that the United States will launch a civilian communications satellite to bring color television to all of China for the first time.

Other officials announced that China will be permitted to purchase a high energy physics atomic accelerator for between $100 million and $200 million. U.S. officials said the accelerator, to be installed in Peking, has no direct military application.

Saying goodbye to Carter in the East Room, Teng said the Sino-American agreements are "not the end, but a beginning." With a flourish, followed by a handshake and a big grin from Carter, Teng said he looks forward to seeing the president again "in the near future" in China. Carter has accepted in principle an invitation to visit Peking, but no date has been announced.

A luncheon at Blair House and a television interview with anchor persons of the three major commercial television networks and the Public Broadcasting System gave the fullest public exposure to the views and personality of the Chinese leader on his current tour.

While exchanging small talk and "nonsubstantive" banter across the elegantly appointed Blair House table, Teng reported proudly that his "bosses" are his two grandchildren, a 4-year-old boy and a girl who is almost 6, whom he said may stage a protest if he fails to bring them back presents from America. The children like "sophisticated toys" such as planes and tanks, he said.

He refuted published reports that he does not like peppery food despite his Szechwan Province origins, revealed that he used to play billiards but gave it up, and said that he wishes he were 12 years old again instead of 74. Teng, who is both direct and slyly playful in casual conversation, said his secret for longevity is optimism despite all difficulties.

On substantive questions, he told his luncheon guests and the television anchors:

"We hold the view that the danger of war comes from the Soviet Union." Russians are seeking bases, strategic resources and raw materials to further their aims. Therefore the United States, China, Japan, Western Europe and other countries, working together, "should try to hamper whatever they [the Soviets] do, undermine whatever they do, frustrate what they try to do in any part of the world."

China does not oppose U.S.-Soviet strategic arms limitation agreements, and can say that "maybe there is a need" for a SALT II pact. However, he charged that such agreements will not succeed in restraining Soviet military power or ambition. "The people of the world should not have illusions in this respect... They should not be lulled by such agreements."

While concerned about the situation in Iran, "We in China cannot do anything about it."

"We will try our very best, by peaceful means, to bring about the return of Taiwan to the mainland and a complete reunification." But China refuses to rule out the use of force because that would be "equivalent to tying up our own hands." Such a thing would encourage the Taiwan authorities to refuse to negotiate with Peking, and, "in the end, lead to an armed solution of the problem."

The most important new ground covered in the interviews concerned the possibility of military action against Vietnam. In addition to confirming the Chinese troop movements, Teng also confirmed that China will continue to ship arms to the Pol Pot regime "as long as this is possible" for use against Vietnamese-backed forces.

He said his only supply route to Combodia is through Thailand. Press reports said China is also sending military supplies via ship through islands off the Cambodian coast.

Last night, Prince Norodom Sihanouk of Cambodia met with Teng at Blair House to discuss the situation in his country, a spokesman for the Chinese leader said.

The former Cambodian leader has been staying in New York City following his address earlier this month to the U.N. Security Council. In that speech he condemned the invasion of his country by Vietnam and the overthrow of Premier Pol Pot.

The spokesman gave no details of what the two discussed. "Prince Sihanouk is an old friend of China, and so it was natural that he meet with the vice premier," the spokesman said.

Both China and Vietnam yesterday reported new small-scale clashes across their common border, each side blaming the other. Teng charged that recent incidents are Vietnamese "provocations" due to Hanoi's military backing from the Soviet Union.

Teng noted that Vietnam launched its "massive armed invasion" of Cambodia shortly after reaching a friendship treaty with the Soviet Union last November. Some U.S. officials, who consider the Soviet-Vietnamese pact a form of advance insurance taken by Hanoi against big-power interference with the Cambodian events, have expressed concern that China might seek to use the Teng visit to Washington for a similar purpose.

Should China strike out against Vietnam during or shortly after Teng's trip here and the signing of bilateral accords, this might imply that the United States had agreed to the attack, according to this view.

When it used military forces outside its borders in Korea and India, China made explicit threats in advance. So far it has not done so with regard to Vietnam, although Teng's remarks in Washington seem to edge some distance in this direction.

So far there are no explicit counter-threats from the Soviet Union. One of the few comments from Moscow about the Chinese troop movements, by Leonid Zamyatin, chief of the Communist Party Central Committee's Information Bureau, depicted reports about the troops as a form of Chinese psychological pressure against Vietnam. Zamyatin said, according to Reuter news agency, that any Chinese attack on Vietnam would be stopped by the Vitnamese.

According to Washington sources, Chinese movements of troops, war-planes and materiel to the Vietnamese border area appears to have been completed, at least for now. With forces in the general range of 100,000 troops involved, the build-up is considered extremely large.

If the Chinese should decide to attack, there would be little to stop them from going all the way to Hanoi within a short time, according to some officials.

Vietnam is reported to have moved several surface-to-air missile battalions to the Chinese border area, and to have placed its troops on full alert.

Along the Sino-Soviet border, China has been evacuating civilians and some military personnel, according to officials. The Soviets are said to be conducting frequent reconnaissance flights to watch the Chinese, but do not appear to have redeployed any military forces.