The naval dockyard in this harbor town 20 miles southwest of Cape Town offers one measure of the impact of the international arms embargo against South Africa.

The materiel on display here forms the lifeblood of the South African Navy -- ships, radar, test equipment, machinery, spare parts -- and most of it dates back to before the U.N. Security Council ban was made mandatory in 1977. The rest was either painstakingly manufactured here or imported in defiance of the embargo -- in either case at great expense.

"If we can't buy something, we try to make it here," said Rudolf G. Stoltze, the dockyard's commander. "We have felt the embargo very much. Any sophisticated weapons system is just not available to us."

Eight years after it was enacted, the effectiveness of the U.N. arms embargo against white-ruled South Africa remains a subject of great controversy.

The ban is generally perceived as a dramatic failure by both South Africa's white-minority government and its most ardent international critics, although they differ on the reasons. The embargo's major achievement, they argue, has been to stimulate South Africa into developing the world's 10th-largest weapons industry.

But a different view has been emerging among some western diplomats and other informed analysts. They believe that while the ban has moved Pretoria to develop its own weapons, it has cost large sums of money and has denied South Africa access to the most sophisticated hardware that defense strategists here believe they need. The lesson of the embargo, they contend, is that while no sanction can prevent South Africa from achieving its strategic goals, it can force it to pay a prohibitively high price.

The question has assumed greater significance in recent weeks as western critics of South Africa's system of racial segregation, or apartheid, push for new economic sanctions against Pretoria. As the only form of mandatory sanction currently in force against South Africa, the arms embargo offers the best evidence on the consequences, intentional or otherwise, that other prohibitions might have.

[U.S. Ambassador to South Africa Herman Nickel warned in a television interview that recent black casualties and a crackdown on opposition to apartheid had boosted support in the United States for economic sanctions against South Africa, Reuter reported from Johannesburg. Nickel reiterated the Reagan administration's opposition to moves to end U.S. investment in South Africa.]

In the view of many independent analysts, South Africa has mastered the manufacture of artillery, small arms, missiles, electronics and communications equipment, but it has lagged behind in such key fields as aircraft, tanks and other armored vehicles. As a visit to Simonstown makes clear, the embargo has also helped transform South Africa's oceangoing Navy into little more than a coastal protection and surveillance unit.

These deficiencies, although publicly dismissed as unimportant by officials here, are said to be causing great concern among South African military planners.

Their seriousness was made clear during last year's successful military foray into southern Angola. During the month-long campaign, South African soldiers faced Angolan troops using Soviet-built T55 tanks, MiG23 jets and SA8 and SA9 antiaircraft missiles.

Each of these weapons, analysts here contend, proved equal or superior to their South African equivalents. The analysts say it was only the superior training and motivation of South African military personnel that carried the day.

"In the past the South African Defense Force has been just as good as it has to be, but that's an uncomfortable position to be in," a defense analyst in Pretoria said, adding that the lesson of the operation "is that they can't match the Soviet buildup that can occur in front-line states like Angola, and it scares the hell out of them."

South African officials concede that their weapons were not designed to counter a Soviet military threat. But they insist that their arms industry is capable of meeting any challenge.

"South Africa is aware of the situation, and we will adapt to changing circumstances," an official source said. "If we find some of our weaponry is obsolete, we will come up with something else."

Any evaluation of the embargo's effectiveness is difficult and speculative because of the secrecy shrouding South Africa's arms industry. Security laws prohibit publication or even discussion of defense information without government approval, and most knowledgeable analysts speak only on condition of anonymity.

South African officials contend that the ban, which was adopted voluntarily by most western powers in 1963 and made mandatory 14 years later, has spurred them to self-sufficiency in arms and had an enormous positive effect on other industries.

South Africa is "grateful," Pieter Marais, chairman of the state-owned Armaments Development and Manufacturing Corp. (Armscor), has said, because the ban provided "tremendous benefits, . . . new skills, new technology, which stimulate our own industry."

South Africa's opponents contend that the key element in the growth of the country's arms industry has been widespread violations of the comprehensive embargo.

Opponents of apartheid have documented several alleged violations of the embargo, among them:

* Sales by Redman Heenan, a British engineering firm, of industrial dies to make bullets and other equipment used to manufacture shells, fuses and rockets, all of it shipped to a South African munitions plant. In 1981 the firm agreed to pay a $380,000 fine to the British government for violating the embargo.

* The clandestine purchase of nearly 100 British-made Centurion tanks by way of Spain and India in 1978. Refitted locally and renamed the Elephant, the tanks remain the backbone of South Africa's fleet of armored vehicles.

* The development by Armscor of a 155-mm artillery system in part with shells and other equipment from a Vermont firm, Space Research Corp. The company's two chief officers pleaded guilty in 1980 to selling arms to Pretoria.

Soviet Bloc countries are not exempt from the charge of embargo-breaking. The suspiciously large quantity of Soviet-designed AK47s in the arsenals of the South African Defense Force and South African-backed rebel movements in Angola and Mozambique has led some analysts who have examined the weapons to conclude that Bulgaria is selling both the guns and ammunition to Pretoria, a charge the Bulgarian government has denied.

Equally curious has been South Africa's ability to obtain spare parts to maintain weapons systems purchased before the mandatory embargo took effect.

The U.N. Special Committee Against Apartheid has alleged that Israeli technicians are maintaining French-built Mirage jets here with spare parts France officially supplies to Israel but that make their way here. Israel denies the charge.

One of the four Armscor employes charged last year in Britain with smuggling arms to South Africa was accused of purchasing spare parts for South Africa's British-designed Buccaneer jet bombers.

But the more common pattern of South African purchases has come in the gray area of technology. The weekly digest Africa News, published in Durham, N.C., reported recently that the granting of licenses to South Africa for military-related items such as aircraft, computers and communications equipment almost doubled during the first Reagan administration while licenses for items on the U.S. government's munitions list have risen from $12 million to $88 million.

A study last year by the American Friends Service Committee in Philadelphia concluded that the arms embargo was "being seriously eroded" by American sales of commercial technology with military applications.

"Rather than outright sales of large weapons systems, exports by U.S. corporations consist to a great extent of the building blocks of modern weaponry -- components, unfinished subassemblies and other technology that can easily be submerged in large, wholesale transactions," the study said.

The extent of those purchases and their potential military application were highlighted last year, when U.S. Customs officials broke up a smuggling ring operated by a West German businessman, Richard Mueller, who allegedly was shipping militarily significant American computers to the Soviet Union via South Africa. According to Africa News, Deputy Assistant Secretary of Defense Stephen D. Bryen told a congressional hearing later the computers had "heavy military value" and should not have been sent to South Africa.

Analysts who defend the embargo acknowledge that all of these sales -- both illegal and gray area -- have taken place, but they contend that the purchases have proved very expensive for Pretoria.

While Armscor officials refuse to comment, informed estimates are that markups for arms purchased on the international black market range between 20 and 100 percent.