Hundreds of firefighters battled throughout the day today to try to contain giant fires touched off by guerrilla raiders last night at South Africa's strategic plants that produce oil from coal.

The bold raids at two of the supersecret installations mark the worst industrial sabotage in the country's history and the most dramatic strike in a gradually escalating guerrilla war against the white-minority government. Officials said two huge fires caused more than $7 million in damage and fuel losses.

In London, the outlawed African National Congress said its forces had carried out the attacks.

Government officials characterized the raids, carried out amid a nationwide wave of school boycotts and labor strikes, as part of a carefully planned "onslaught" against South Africa.

In a sophisticated, three-pronged attack, the saboteurs set alight seven fuel tanks at Saso I and the nearby Natref refinery, about 40 miles southwest of Johannesburg.

At the same time, an attempt to destroy Sasol II, a new $2.8 billion plant about 80 miles east of here, failed when seven bombs went off but did minimal damage, according to police. Production at both plants went on without interruption, officials said.

Sasol, the state-run coal, oil and gas corporation, oversees the coal conversion project, which is South Africa's insurance policy for any future world oil embargo against it because of its racial policy of apartheid. South Africa has no known oil reserves, yet at least 25 percent of its rapidly industrializing economy depends on oil.

Johannes Stegmann, managing director of Sasol, said the first blasts occurred at 11:40 p.m. Sunday at Sasol I, setting ablaze four tanks, including one that contained butadiene, the raw material for synthetic rubber.

At the same time, explosions went off at Natref igniting three tanks, including two full of jet fuel. A security guard at Natref was shot in the shoulder when he encountered one of the fleeing saboteurs, Stegmann said.

Shortly afterwards, seven bombs went off inside one of the processing units of Sasol II.They caused only slight damage to a reactor in the plant, police said.

F. W. De Klerk, minister of mineral and energy affairs, said the incident make clear that South Africa is facing an organized assault aimed at disrupting stability and order in the country, according to the South African press agency.

Stegmann said, "There is little doubt that it was a terrorist attack."

Roadblocks were thrown up quickly after the blasts, but by late last night, police had not announced any arrests.

The Sasol technique of manufacturing oil from coal is based on a well-known but little-used West German process and is currently the object of intense interest among U.S. legislators and companies who are seeking to develop synthetic fuel plants in the United States. A congressional delegation headed by Rep. James Wright (D-Tex.), visited Sasol II in January to investigate the possibility of acquiring the Sasol technique.

Pretoria has announced plans to build a Sasol III at a cost of $3.8 billion to begin producing oil in 1982. While government officials claim the three plants could eventually supply 47 percent of South Africa's oil needs if current levels of consumption are maintained, independent experts say the figure is probably closer to 30 percent.

South Africa's prinicpal supplier of oil had been Iran, which delivered 90 percent of the country's imported crude petroleum until the shah was overthrown in 1979.The National Iranian Oil Co. still holds a 17.5 per cent interest in the Natref refinery under an arrangement set up under the shah.

Police believe the saboteurs entered both Sasol plants by cutting holes in the security fences. Some politicians today decried the lax security at the plants and suggested that the Army take over their protection in the future.

The African National Congress, which has close ties to the Soviet Union, has claimed responsibility for an increasing number of guerrilla attacks in the past year, including assaults on four police stations that left two black policemen dead.

The most recent incident occurred on April 4 at a police station in downtown Johannesburg. Rocket-propelled grenades were used in that attack.

Whle the government sees the congress as a major foe, it has won allegiance among a growing number of blacks, especially youths who left the country after the uprisings of 1976 and 1977.

Black activists have begun a nationwide campaign for the release of the congress' former president, Nelson Madnela, who has been held since 1962 as a policitcal prisoner on Robben Island, where he is serving a life sentence for sabotage.