The senior American diplomat involved in negotiations with South Africa over the future of Namibia said today that "free and fair" elections are possible in the troubled region, indicating that substantial progress is being made in resolving one of southern Africa's most explosive problems.

"I think we have the basis for an agreement," U.S. Ambassador Donald McHenry said on arrival here from Tamzania.

McHenry said that South Africa has dropped its plan for establishing a black government in Namibia, which it controls in defiance of the United Nations, and is moving toward acceptance of free elections under U.N. supervision.

McHenry, who is U.S. deputy representative to the United Nations, refused to describe the results of the latest round of negotiations between representatives of five Western nations and South African Prime Minister John Vorster as a "breakthrough," bu he said the "ingredients of an agreement" emerged during the latest round of talks in Cape Town that ended Friday. He indicated that they fall within the framework of U.N. resolution 385, which calls for elections under the world body's supervision.

McHenry, who is the senior American representative in the Western Contact Group, said VOrster's decision to appoint an "adminstrator general" in the territory meant, in effect, that his plan to set up an independent government of balck Namibians is now dead.

The apparent package deal now being worked out in stages by the five Western powers - the United States, Britain, France, West Germany and Canada - is thought to include provisions allowing the participation of the main opposition nationalist group, the South-West African People's Organization (SWAPO); the release of all Namibian political prisoners, including some SWAPO dissidents in ZAmbian "rehabilitation camps" and Tanzanian jails; and the phased withdrawal of South African troops stationed in the territory now.

SWAPO had rejected the South African plan as a disguised extension of that country's system of apartheid and demanded U.N. supervised elecitons on the basis for establishing a truly representative independent government.

It has also been demanding the withdrawal of all South African troops from the former German colony prior to any elections. The South African government is understood to be still rejecting this condition.

Several SWAPO officials denounced the South African decision to appoint na administrator general after it was announced Saturday, but Western diplomats here believe that these denunciaions wer made before SWAPO leaders had a chance to be briefed on the meaning of the latest South African concessions.

McHenry said that U.S. Ambassador to the United Nations Andrew Young had been "encouraged" by SWAPO President Sam Nujoma to continue the Western initiative over Namibia during their talks in Mozambique last month.

Nujoma has since refused to meet in Tanzania with British and American envoys, however, leaving it unclear precisely what his attitude is toward the Western effort to find a peaceful solution to the Namibia dispute.

"We have come a long way and we have a long way to go, and it's going to require a lot of hard work to finally resolve the issue," McHenry said. But he added that he is "optimistic" after comparing the progress made inthe past three or four months ot the "31 years of deadlock" that preceded it.