President Shehu Shagari of Nigeria, the second-largest foreign supplier of U.S. oil, cautioned the Reagan administration today against tilting its African policy toward white-ruled South Africa or giving arms to the rebel forces of Jonas Savimbi in Angola.

"If the United States is willing to support rebels in a sovereign African nation, it would be extremely serious," Shagari said of Angola at a press conference during a state visit to Britain. "I don't believe [Washington] will do it because it would be very unwise."

While Shagari's comments fell short of a threat to cut off oil shipments to the United States or to take over U.S. oil interests, Nigeria has been known to move swiftly in such cases rather than issue threats. In August 1979, Nigeria nationalized British Petroleum's $150 million share in a joint venture when Britain appeared likely to lift sanctions against the interim government in what is now Zimbabwe.

Gulf Oil of the United States holds 40 percent of a joint venture with the Nigerian state oil company that produces 390,000 barrels a day, and several other U.S. companies operate in Nigeria.

[Regarding the possibility of U.S. aid to Savimbi, the government-owned Tanzanian Daily News commented that "such American action would be worse than the Soviet invasion of Afghanistan," Reuter reported. Also, in an Angolan radio broadcast monitored by Reuter in London, Angola accused the Reagan administration of supporting South Africa in a new wave of attacks on its black-ruled neighbors.]

Although he indicated that he would give the West a little more time to try to push South Africa into meaningful talks to end its domination of Namibia, Sharagi also warned that Nigeria "will use every means at our disposal" to fight "the evil system of apartheid" in southern Africa and any "collusion and encouragement of Western powers."

Shagari is the fourth important African leader this week to express concern about the Reagan administration's approach to Africa as it reassesses the Carter administration's policy of strong support for black nations at the expense of South Africa.

Shagari's tone was characteristically more cautious than that of Prime Minister Robert Mugabe of Zimbabwe, President Samora Machel of Mozambique and Organization of African Unity Chairman Siaka Stevens of Sierra Leone, all of whom spoke out earlier this week against the drift of Reagan administration statements on Africa.

They expressed their strong displeasure with indications that Reagan might take a friendlier attitude toward South Africa because of its anticommunist stance and might give military support to Savimbi's rebels in their continuing resistance to a black Angolan government aided by Cuban military assistance and supported by the Soviet Union.

"I believe the new U.S. administration is studying the African situation" and has yet to make final policy decisions, Shagari said here, echoing the diplomatic line of his British hosts. "I believe in giving [the Reagan administration] the benefit of the doubt until policy is announced."

Shagari emphasized, however, Nigeria's efforts to end all foreign support for apartheid and white-minority rule in South Africa, as well as his strong belief that only tough economic sanctions can force South Africa to pull out of its war with black rebels in Namibia and negotiate the territory's independence. Shagari said Nigeria also would continue giving "all necessary aid to freedom fighters in Namibia and South Africa."

But Shagari indicated that he was sympathetic toward the urging of British Prime Minister Margaret Thatcher that Western powers, including the United States and Britain, be given more time to try to bring South Africa to the negotiating table before African nations force the United Nations to consider economic sanctions against South Africa.

"Mrs. Thatcher still nurses the hope that she will be able to persuade South Africa to agree to talks and negotiations," Shagari said. "If she can do that, well and good. She has great hopes. I wish her luck."

Shagari and Nigerian diplomats accompanying him here were urged by the British to wait until the Reagan administration formally decides what to do about Namibia and South Africa, according to informed sources. Pushing too quickly for sanctions, the Nigerians were told by the British, could force a U.S. veto of any U.N. Security Council resolution for sanctions against South Africa and possibly result in a Reagan administration policy less to black Africa's liking.

Meanwhile, Britain is urging the Reagan administration to decide as soon as possible whether it will continue Carter's support of a United Nations independence plan for Namibia initiated jointly by the United States, Britain, France, West Germany and Canada or "come up with a better idea," according to informed sources.

Despite private pleasure with the appointment of Africa specialist Chester Crocker as assistant secretary of state for African affairs, British diplomats are known to be nervous about the Reagan administration's developing policy on Africa and some of the statements already made in Washington.

While not disagreeing with the concern of Reagan and Secretary of State Alexander Haig about Soviet influence and Cuban troops in parts of Africa, the British emphasize the diversity of African power politics and their firm belief that it would be wrong to apply to Africa a single "conspiracy theory" of Soviet influence. The British also believe that black Africa would only be pushed closer to the Soviet Union by an American policy that tilted toward South Africa.

Noting that Mugabe, the former guerrilla leader overwhelmingly elected to rule Zimbabwe, has since kept his distance from the Soviets, British diplomats believe the only way to solve the crisis in Namibia is to allow free elections that are likely to be won by the black rebels now fighting South African troops there. They believe both the Reagan administration and South Africa need to be convinced that this is the best possible outcome for the West.

British and American diplomats were in close harmony on African policy during the Carter administration. One potentially serious clash was averted when Thatcher was persuaded by her foreign secretary, Lord Carrington, to change her attitude toward the then renegade British colony of Rhodesia and make possible British-led negotiations, backed by the United States, for its independence under black-majority rule as Zimbabwe.