Vietnamese forces today escalated their offensive against Cambodian guerrillas along the Thai-Cambodian border, pounding strongholds of the communist Khmer Rouge with an artillery barrage that forced thousands of Cambodian and Thai civilians to flee the border area, Thai military sources and western relief officials said.

The Vietnamese shelling, some of the heaviest in their current dry-season offensive, spilled over onto Thai territory and drew retaliatory fire from Thai gunners, according to Thai military officials. They said that troops, artillery and tanks were ordered into positions opposite the battle zone about 25 miles south of the Thai border town of Aranyaprathet to repel any Vietnamese incursion.

The Vietnamese offensive also apparently has prompted retaliation from China, which strongly backs the Khmer Rouge. Reports from both Peking and Hanoi said Chinese gunners have shelled Vietnamese positions across their border in the last few days.

According to relief officials, at least 12,000 Cambodian civilians were evacuated today from Khmer Rouge settlements in the Phnom Malai area of western Cambodia to sites inside Thailand. Thai military officials estimated that the Cambodian evacuees numbered between 20,000 and 40,000.

The officials said at least two Thai villagers were killed and two were wounded when more than 100 Vietnamese shells landed on Thai territory. Casualties among the Cambodians and Vietnamese were unknown.

Some ground fighting was reported between Khmer Rouge guerrillas and Vietnamese forces backed by tanks and armored vehicles in the Ang Koban area south of the Thai border town of Ban Nong Pru, but details were sketchy.

Farther south, a separate battle was raging in a Khmer Rouge zone across the border from the Thai town of Trat, the Thai military reported.

After overrunning every major Cambodian base of the main noncommunist resistance group, the Khmer People's National Liberation Front, the Vietnamese earlier this month launched a pincer attack on the Khmer Rouge strongholds in the Phnom Malai area from the east and south.

Today's attack came as foreign ministers of Southeast Asia's noncommunist nations concluded a two-day conference in which they called on the international community to increase military aid to the Cambodian resistance.

As its gunners were pounding the Peking-backed Khmer Rouge, Hanoi reported that Chinese artillery and ground attacks across the northern Vietnamese border in recent days had destroyed several villages and caused unspecified numbers of casualties. The official Vietnam News Agency reported damage up to six miles inside Vietnamese territory.

China said its gunners were responding to Vietnamese shelling across the border.

According to Prince Norodom Sihanouk, the head of a U.N.-recognized Cambodian coalition government made up of three resistance groups, Chinese leader Deng Xiaoping promised him in October that China would teach Vietnam a "second lesson" if the Cambodian resistance faced serious military defeat, the British newspaper The Manchester Guardian reported.

Chinese troops invaded Vietnam in 1979 and fought a brief border war following the Vietnamese invasion of Cambodia, which ended nearly four years of brutal rule by the Khmer Rouge.