Western and African envoys at the United Nations last night anxiously assessed the damage inflicted by South Africa's military raid deep into Angola on their elaborate, diplomacy for a peace settlement in Namibia (Southwest Africa.)

Angola asked for an emergency meeting of the Security Council on the South African air and ground thrust 150 miles inside its territory against guerrilla bases of the Southwest African People's Organization (SWAPO). Angola's Cuban-reinforced troops have been put on a national alert.

President Carter told reporters in Portland, Ore., "We hope it was just a transient strike in retaliation and we hope it is all over." Neverthesless, the United States and other Western nations are all registering alarm about the impact of the raid on their efforts to bring independence and black majority rule to Namibia by the end of this year. This has been the brightest prospect for diplomacy in all of southern Africa.

There is speculation - which South Africa strongly denies - that the large-scale paratroop operation into Angola was designed to sabotage the Namibian diplomacy of the United States, Britain, Canada, France and West Germany.

Another theme of diplomatic speculation is that the raid had a more political objective: to placate hard-line Afrikaaners inside the South African government who opposed the acceptance of the Western plan for Namibian independent announced for the government of Prime Minister John Vorster on April 24.

South Africa rules Namibia under an expired League of Nations mandate. The United Nations has endorsed SWAPO as the successor to govern the nation, but SWAPO will have to win that right in an election under the Western plan, which SWAPO is balking at accepting.

South Africa, which claims that its cross-border attack into Angola was "spontaneous" provoked by intensified guerrillas attacks from that Marxist-ruled nation, said yesterday that its army and air units destroyed the main SWAPO guerrilla headquarters in Angola.

If any Angolan troops, or any of the estimated 20,000 Cuban soldiers who have been in Angola since that nation's 1975-76 civil war "were hit in the process, it was coincidental," said South African Chief of Staff Lt. Gen. Jack R. Dutton.

Dutton, speaking in Pretoria, said South Africa lost only five men in Thursday's attack on Cassinga, a base 150 miles inside Angola which he said in code-named "Moscow," and against two other border bases.

These casualties, he said, were "not comparable to the larger losses incurred by the terrorists," as South Africa describes the Marxist-oriented SWAPO.

SWAPO President San Nujoma said in New York yesterday that "hundreds of women, children and elderly people" were killed in the raid, which he said hit at civilian camps, South Africa denied it had hit "refugee camps" as Angola had claimed Military sources in Johannesburg said there were 600 to 1,000 guerrillas at the main base, including women.

Angola Defense Ministry sources said that South African paratroops and other forces, preceded by bombing runs of jet fighters, landed at Cassinga at dawn Thursday, joined by forces on the ground, and withdrew during the night.

No information on the size of the raiding force has been disclosed. Unofficial reports from Johannesburg said 300 to 700 South African troops were involved.

This was the first acknowledged border penetration by South Africa since the 1975-76 Angolan Civil war in which South African troops ended up on the losing side - as did the United States which had originally provided covert support. The Soviet Union and Cuba backed the winner, the Popular Movement for the Liberation of Angola. Since then, however South African planes reportedly have conducted regular supply runs to one of the losing factions in the civil war, the National Union for the Total Independence of Angola, which continues guerrilla war against the government of Agostinho Neto in Luanda.

Although South Africa contends that Thursday's raid was a sudden decision, there are unofficial reports that more than a month ago South Africa called up 3,000 to 6,000 reservists for military action involving Namibia.

A central issue in SWAPO'S complaints about the Western plan for Namibian independence is the staging for withdrawal of South African troops from Namibia and their replacement by U.N. peacekeeping troops.

A meeting of the SWAPO executive council and Western representatives to try to resolve these and other differences originally had been scheduled to be held in New York yesterday, but is now set for Monday.

From Johannesburg, James MacManus of the British newspaper, The Guardian, reported yesterday that for several months military attaches in Pretoria have been aware of South African army plans for a major strike at guerrilla bases in southern Angola. It had been thought, however, that South Africa would try to maneuver Nujoma into making a clear break with the Western plan before striking.

Earlier this week, however, diplomatic signals from Africa and at the United Nations indicated a more promising outcome for the fresh round of Western "clarification" discussions with SWAPO, MacManus reported. At the same time, SWAPO's military wing, the People's Liberation Army of Namibia, has been increasing the scope and skill of its insurgency campaign in northern Namibia.

One unidentified Western diplomat in Johannesburg was quoted as saying of the South African raid: "If the operation was not a deliberate attempt to obstruct Western diplomacy then they (the government) have lost all sense of reality, because that is what it has achieved."

South African Foreign Ministry Pik Botha said, however, "South Africa remains willing and ready to implement the Western proposals for a settlement of the Southwest African issue, but we also keep insisting that the terrorists should end their acts of violence."

Angola Radio said, "This hateful attack . . . is part of imperialist aggressive action in southern Angola and is preparatory to a new invasion of our country."

The United States, along with Britain, Canada and other nations, has deplored the South African action The State Department, which called in South Africa's ambassador to Washington on Thursday to protest, expressed its "dismay . . . and our grave concern at the implication" of South Africa's actions and "asked for an urgent explanation."