Relations between the two countries could easily be positive, given Afrikaner Germanophilia, but much depends on what happens to the Commonwealth and South Africa's position within it.
Is there an Anglo-German cold war? Has the Commonwealth broken apart entirely? What is the world like?
Perhaps most critically, what does Germany want with South Africa-controlled Southwest Africa? I can imagine a situation where South African whites might be inclined towards a German alliance but this inclination might be wrecked by Germany's desire to reclaim its African colony.
Just because the Afrikaners are racist doesn't mean they'd buddy up to Germany, although I can imagine some will. The Afrikaners are also very staunch Calvinists, and if there are Nazi anti-Christian excesses (real or imagined), that could alienate them.
"What? You want us to work with some godless heathen who sacrificed some Russian hostages to Odin?"
Whilst the Afrikaners where of mostly Germanic descent, that doesn't mean they woud support the nazis. There was a huge difference between the national party which governed a democracy and the nazis who were obviously far more extreme.
And then you of course have English South Africans and liberally minded Afrikaners such as Smuts,So I think an alliance is unlikely even if SA leave the commonwealth.
Brits only controlled Southern Africa (Rhodesia, Republic of South Africa, etc.) for a half century. They ousted Afrikans-speaking Boers (Dutch descent) during the late 19th century, but lost control after WW2. Part of the reason they lost control of South Africa was too many casualties among some of the English-speaking SA elite.
wasn't (vague) plan for Germany to retain Belgian Congo? (could see them wanting Tanzania, formerly German East Africa, to span across Africa?)
that would probably only be feasible with some collaboration from SA and Portugal?
Didn't Hitler's loose plans for Africa include a Afrikaner superstate?
Remember, South Africa was at war with Germany.
I think playing both sides sounds very plausible.I could see the SA government trying to play both sides off (perhaps get concessions out of the US by threatening to give basing rights to the KM)