Twenty new victims of El Salvador's national blood feud were buried in a weed-infested field on the outskirts of this provincial capital today about 24 hours after they had been killed in an ambush by leftist guerrillas.

The war that has cost 30,000 Salvadoran lives and become a central testing point for the Reagan administration's forcefulness in world affairs came into Chalatenango on this hot, still afternoon. It arrived aboard two pickup trucks carrying seven coffins and a military transport in which were stacked the bodies of 13 persons whose relatives could not afford coffins.

Fifty miles away, in the capital of San Salvador, it is possible for a foreigner to ignore the war by traveling a well-beaten path from office building to hotel to restaurant.

Last year, the guerrillas dropped the urban terrorism that in 1977 marked the beginning of the intensive war between left and right, moving their campaign out of the city into the countryside. As a result, the war can be dealt with as an abstraction almost as easily in San Salvador as it can be in policy meetings in Washington.

But in Chalatenango and the other municipalities in the northern provinces where the guerrillas of the Farabundo Marti National Liberation Front (FMLN) are concentrated, the war is only a few minutes and a few miles away. It frequently spills out of the rugged mountains and deep ravines of the surrounding countryside into the sleepy squares of the small towns that are the nerve centers of this phase of the war.

The FMLN is named after a Salvadoran communist leader who helped organize a peasant revolt in 1932 that led to the slaughter of tens of thousands of the peasants. That outburst of violence polarized the rich and the poor, the right and the left, into patterns that continue to contribute greatly to the upheaval, coups and indiscriminate slayings that have marked Salvadoran life in recent years.

Yesterday, the war erupted five miles northeast of Chalatenango at a hamlet called San Jose Las Flores. Peasants who wanted to go into Chalatenango to get supplies had asked for, and received, permission to join a four-truck Army convoy that was rotating 85 soldiers from a remote outpost back to the garrison in the provincial capital.

A group of guerrillas estimated by some of the surviving soldiers as numbering at least 100 was waiting for the convoy just outside San Jose Las Flores and opened up with deadly efficiency, sweeping the convoy with automatic rifles, grenade launchers and at least one machine gun. When the firing stopped and the guerrillas had fled--leaving behind no known dead--18 of the peasants and 11 soldiers of the Fourth Brigade lay dead or dying.

Fifteen other soldiers were wounded in the exchange, a military spokesman said.

The families of the dead civilians and soldiers shared their grief and their anger today with about two dozen foreign journalists and cameramen who were alerted by the government that there would be a funeral procession and burial of war victims here.

The military-civilian junta headed by President Jose Napoleon Duarte has frequently and bitterly complained that the foreign press focuses on brutal excesses committed by government troops and ignores outrages committed by the guerrillas. The junta has begun a new effort in recent days to make it easier for journalists to have access to survivors of such incidents.

A 7-year-old boy spoke rapidly and in a quavering voice into the microphones of Canadian Broadcasting and German television and described for faraway listeners the terror of the ambush. Moments later, he watched as a bulldozer filled in the earth over a mass grave that held five coffins and eight corpses wrapped in blankets or cloths.

Calls for revenge and wails of sorrow filled the air as seven other coffins were lowered into individual graves in the abandoned lot that had been hurriedly turned into a makeshift graveyard. The remaining nine victims were buried elsewhere.

A score of the surviving soldiers from the Fourth Brigade stood on the crest of the overgrown field and fired off a final salute to their comrades. As the shots from the M16 automatic rifles snapped harmlessly into the air, the women and children who had been through yesterday's attack scrambled to the dirt in terror.

When they realized that it was a ceremonial firing instead of a new attack, they numbly rose and continued burying their dead.