Vietnamese forces in Cambodia today turned their guns on the last resistance base still intact on the Cambodian side of the border with Thailand, attacking guerrillas loyal to Prince Norodom Sihanouk at a northern stronghold opposite the Thai village of Tatum, resistance and Thai military sources said.

The Thai military reported later that about 800 Vietnamese soldiers had crossed the border in the area of the fighting. Thai troops backed by artillery were battling to dislodge the intruders from three hills on Thai territory.

The Thai military said later that two Thai officers and at least 40 of Sihanouk's guerrillas had been killed, United Press International reported. No estimate of Vietnamese casualties was available.

The Vietnamese attack on Sihanouk's Green Hill camp on an escarpment about two miles from the northern Cambodian border with Thailand began at 4:30 a.m. with an artillery barrage, followed by an infantry thrust, Truong Mealy, a Sihanouk spokesman said.

He said guerrilla defenders inflicted "quite heavy casualties" on the Vietnamese, who had not yet penetrated the camp's "first line of defense" about seven miles from its headquarters. Mealy said fighting also was going on farther inside Cambodia, about 17 miles from the Green Hill camp, and that guerrillas found the bodies of some Vietnamese soldiers and taken their weapons.

Thai military sources confirmed that the Vietnamese had begun a long-awaited operation against the camp but said they had no details of the fighting.

The Thai military charged that Vietnamese artillery shells landed in Thailand's Surin Province when gunners overshot the Green Hill camp.

Vietnamese shelling was also reported on Cambodia's western border with Thailand, north of the Thai town of Aranyaprathet. Refugees from Cambodian resistance settlements overrun earlier in the current Vietnamese drive had to flee two evacuation sites and move farther into Thailand, according to reports from the border.

Since the Vietnamese began their offensive in November, they have overrun or forced the evacuation of all major border camps of the communist Khmer Rouge and the anticommunist Khmer People's National Liberation Front, the two largest factions in a three-party coalition of Cambodian resistance groups fighting the six-year-old Vietnamese occupation of their country. Sihanouk, 63, is president of the coalition.

Until now, the smallest faction, the Armee Nationale Sihanoukiste, loyal to the former Cambodian monarch, had been spared in the offensive. In a recent interview, Sihanouk said the Vietnamese either planned not to attack his forces in an effort to sow suspicions of a "secret deal" between him and Hanoi, or were merely saving his camp for "dessert" in their current campaign.

In launching a drive against the Sihanouk faction, which claims 10,000 fighters but poses no serious military threat to the Vietnamese, Hanoi's forces apparently hope to deny the resistance coalition any last claim to a "liberated zone" on Cambodian soil.

Since November, the Vietnamese have forced practically the entire 250,000 Cambodian population of this zone along the border to flee into Thailand. Those evacuated include 32,000 civilians who fled Green Hill and nearby camps during Vietnamese attacks in April 1984 and gathered at a site called Camp David, nine miles north of the border.

Currently, according to western relief officials and resistance sources, there are no civilians left in the Green Hill camp. Sihanouk has said the camp is defended by about 5,000 of his fighters, with the rest of his guerrilla force operating inside Cambodia.

Sihanouk is scheduled to return to Bangkok later this week from a tour of Australia and New Zealand, then fly to Canton, China. Sihanouk, whose uneasy coalition government is recognized by the United Nations, has called on Chinese leaders to relieve Vietnamese pressure on the resistance by teaching Hanoi a "second lesson," reminiscent of the 1979 Chinese invasion of several northern Vietnamese provinces.

Mealy said the "defense ministers" of the three resistance factions agreed in a meeting Sunday that Khmer Rouge and Khmer People's National Liberation Front guerrillas would aid the Sihanoukists if their Green Hill camp were attacked.

The attack came as Australian Foreign Minister Bill Hayden was preparing to visit Hanoi to seek a solution to the Cambodian conflict.