Cambodia its society and economy already in ruins, is facing the prospect of a major famine that could send a massive and dangerous flood of refugees into neighboring Thailand, according to analysts here and in Bangkok.

The prospect of famine comes after three years of turmoil during which hundreds of thousands of Cambodians are believed to have died from disease, starvation or political executions under the radical pro-Peking Khmer Rouge regime.

The Khmer Rouge were ousted earlier this year by pro-Moscow Cambodian rebels assisted by the regular Vietnamese army, although Khmer Rouge units continue guerilla war in the countryside.

Contending Cambodian and Vietnamese armies have seized or destroyed rice stocks and frightened away peasants just at the crucial planting season in Camboda's north-west rice bowl bordering Thailand. A drought-diminished winter rice crop is adding further threats of starvation or malnutrition for hundreds of thousands, with Cambodia's new government unable to expect help from its Vietnamese ally which is also suffering bad crops.

"It is very probable that there will be severe food shortages in the next three or four months," said one analyst. "This will not only increase the already general suffering of the people, but create a massive flow of refugees."

Such an exodus would increase the danger of clashes between Cambodian and Thai forces, and would put a new, enormous burden on international and Thai relief officials trying to house and feed 150,000 Indo-chinese refugees already inside Thailand.

The Thais have tried to maintain strict neutrality in the war being waged just across their border between a new Hanoi-backed Cambodian government and Peking-backed Khmer Rouge insurgents. The Thais recently let an estimated 50,000 to 80,000 Cambodian civilians and Khmer Rouge troops cross the border to escape a major Vietnamese offensive.

A Thai government spokesman was quoted as saying: "They're liable to shoot our guards if they are not allowed in, and when Thai guards are shot at, they fire back and immediately when that happens we are involved."

In a speech yesterday quoted by today's Bangkok Post, however, Thai Prime Minister Kriangsak Chamanan warned that his forces would retaliate against any intrusion by Cambodian military forces.

"Any military maneuver onto Thai soil by these forces would be regarded as a threat to the kingdom," Kirangsak was quoted as saying.

Fighting between the Khmer Rouge forces and the Vietnamese has been particularly fierce in th rice-growing region near Thailand since the Cambodian capital, Phnom Penh, fell to the Vietnamese in early January and a pro-Hanoi government led by Heng Samrin was established.

The pro-Peking Khmer Rouge, who had imposed a harsh barter economy on the country during the three years they governed in Phnom Penh, anticipated the Vietnamese victory and confiscated large amounts of stored rice to feed their forces retreating to mountain strongholds. "Both armies, the Khmer Rouge and the Vietnamese, grabbed lots of rice and burned much of the rest they found," said one analyst.

In the last several weeks, the new Cambodian government, backed by several divisions of Vietnamese troops, has been trying to wipe out Khmer Rouge resistance in the northwest so peasants could plant rice beore the rainy season began in late May. Analysts said it is unlikely the Khmer Rouge insurgency can be crushed. They said that the food crisis has probably gone too far to be solved now even if the Khmer Rouge suddenly surrendered.

The Heng Samrin government has promised the restoration of a more normal economy, as well as freedom to practice Buddhist religion and normal family life which was discouraged by the Khmer Rouge. But the new govenment has suffered from nationalist resentment of its close association with the Vietnamese.

Vast population dislocations occurred when the Khmer Rouge, after defeating a U.S.-backed government, emptied the cities in 1975. Further chaos has followed the Vietnamese victory.

Refugees crossing into Thailand report that many people fled their villages along with the Khmer Rouge troops who retreated in face of the Vietnamese advance. Others took refuge in cities, the places where Vietnamese troops seemed to have managed to restore some order.

Not enough peasants remained to harvest the winter rice crop, which had been stunted by drought, or to plant a new rainy season crop. Refugees say stocks have so dwindled that there is little rice left for planting anyway.

Last year, despite heavy flooding that adveresely affected agriculture in other parts of Southeast Asia, Cambodia's northwest harvested a good crop. The Khmer Rouge prime minister Pol Pot, said there was enough to give 625 pounds annually to each of Cambodia's estimated 8 million people.

Refuges have reported, however, that at the time Pol Pot fled from Phnom Penh in January, only about three to four months of rice remained in stock, and that has now almost run out. Much of it is being hoarded by the Khmer Rouge so that their insurgency can survive, even with supply lines to China now severely restricted.

The large mass of Khmer Rouge and civilians that entered Thailand last week sought sanctuary from a coordinated, tank-led Vietnamese assault near the town of Poipet. Most of the refugees reportedly have moved back to the Cambodian side of the border in the heavily forested Lao Loeng foothills where Vietnamese tanks cannot operate.

With the threatened famine and continued fighting, Thai officials fear more incursions that might be followed by Vietnamese forces in hot pursuit. That would further complicate Bangkok's efforts to maintain its security and neutrality against well-armed and aggressive Indochinese neighbors. Kriangsak reportedly told U.S. refugee coordinator Dick Clark April 17 that Bangkok would continue its policy of not pushing genuine refugees back across the border. CAPTION: Picture, Cambodian farmers carry bundles of rice during last harvest, before contending Vietnamese and Khmer Rouge forces seized or destroyed rice stocks. By Elizabeth Becker - The Washington Post; Map, no caption, By Richard Furno - The Washington Post