I know they probably didn't have much real power, but were they allowed even as a token gesture?
In apartheid South Africa, no. There were constitutional limits restricting membership of the House of Assembly (and the Senate, when it existed) to white people.
The qualifications of a member of the House of Assembly shall be as follows:― He must― [...] be a British subject of European descent.
(It was later amended to change "British subject" to a reference to "Union nationality".)
Republic of South Africa Constitution Act 1961, s. 46:
No person shall be qualified to be a member of the House of Assembly under this Act, unless he― [...] is a white person and is a South African citizen
In 1983 the Botha government introduced what was known as the Tricameral Parliament, which had separate chambers for white, coloured (mixed-race) and Asian people, but still no representation of or by those classified as black. Under the separate development theory of the regime, black people were supposed to be represented in their nominally-autonomous homelands.
In the early days of the Union there were some black people entitled to vote in parliamentary elections in the Cape Province - there was a non-racial franchise based on property qualifications, although those qualifications kept white voters in the majority. From 1936 they were removed from the common voters rolls and instead would separately elect three MPs. But these MPs had to be white; at no time from 1910 to 1994 was any non-white person allowed to be a member of the House of Assembly.
For a great deal of detail on this (the earlier Union period, that is, not the later developments) I referred to By Due Process of Law?: Racial Discrimination and the Right to Vote in South Africa, 1855-1960 by Ian Loveland.
EDIT: no doubt /u/khosikulu will be along soon to fill in more details and probably answer about Rhodesia as well.
In Southern Rhodesia there absolutely were black members of parliament, both in the Rhodesian and the Federal Parliaments.
I'm going to talk about the Federal Parliament initially as that was the first opportunity for African politicians to run for seats in Parliament. The Federation of the Rhodesias and Nyasaland, also known as the Central African Federation, was a economic and political partnership between Southern Rhodesia, Northern Rhodesia (Zambia) and Nyasaland (Malawi) that emerged in the early 1950s out of a growing sense of liberal multi-racial partnership within the region. Southern Rhodesia led the charge and would control the Federation in almost every regard, and the Federal Party of then Prime Minister Godfrey Huggins. would go on to sweep the election in 1953.
The Federal Parliament was unusual for colonial Africa in that there were seats specifically reserved for black Africans in Parliament - six out of thirty-five (i.e. two each from Nyasaland, Northern Rhodesia and Southern Rhodesia). Those African Federal Members of Parliament were even afforded the same privileges that the European members were, including payment, allowances, and other benefits which caused some controversy amongst both the European and African portions of the populations in the region. Before 1953, Africans could only be elected to local government i.e. municipal township councils.
The first two black African MPs from Southern Rhodesia to sit in the Federal Parliament were Jasper Savanhu and Michael Hove, editors of the African newspapers, African Weekly and Bantu Mirror respectively. They were young, well-educated, middle-class African men who had some connections with the African nationalist movements in urban Salisbury but were largely seen as being supporters of the liberal multi-racial partnership schemes such as the Capricorn Africa Society or the Interracial Association. They were derided by the African nationalists as puppets of the white state and had been strongly encouraged not to take up their seats following the election, but Savanhu, for example, insisted that they had been given a chance to speak for the African in the white-dominated Parliament and should seize the opportunity.
Although only relatively short-lived (the Federation would dissolve in 1963), the inclusion of black MPs in a small parliament was a noticeable move at the time towards racial partnership and would eventually have an effect on the political environment in Southern Rhodesia, a nation with a much larger white population than its two neighbours and a more firmly entrenched system of political government.
In Southern Rhodesia itself, black Members of Parliament were permitted after the 1961 constitution had been introduced, itself clouded in controversy due to the involvement of Joshua Nkomo, the leader of the nationalist movement in the nation, with the negotiations. Furthermore, the Rhodesian Front party which would lead Rhodesia from 1962 to 1979, strongly opposed the presence of black Africans in parliament and made this abundantly clear in later years when it was in power.
Nevertheless, the 1961 constitution provided fifteen African seats in the Southern Rhodesian Parliament and subsequently the 10th Parliament of Southern Rhodesia which sat between 1962 and 1965 saw fifteen black MPs sitting on the benches in the House. From 1962 to 1979 when Rhodesia became Zimbabwe, the Rhodesian parliament would always see black African MPs present, with the number fluctuating dependent on the political environment at the time. During the December 1977 negotiations regarding the internal settlement between Ian Smith's RF and the African parties of the UANC of Abel Muzorewa, ZANU (a rejected branch of the ZANU fighting the war but almost entirely separate and under the leadership of the deposed Ndabaningi Sithole) and various groups representing rural "tribal" interests (the terms of the documents, not of myself), the issue of black MPs was a prominent one.
The Internal Settlement was going to see Black MPs take control of the house through numerical superiority. Negotiations swayed between a Parliament of 80, 100, and 120 with either a proportional or fixed number of white MPs - the RF wanted a third of all seats to be White, or fixed at 20 with a blocking vote. Viewing the transcripts of the talks, it became apparent that Smith and his colleagues had seen how ineffectual a small number of African MPs had been in passing acts in a white majority parliament. Parliament had usually voted along racial lines which had exacerbated tensions within the House whilst also preventing the African voice from genuinely having any impact on proceedings. Such acts also highlighted the disdain most of the white RF MPs had for the African members.
A 1974 vote on African education for example, saw all sixteen African MPs vote in favour of the motion, and thirty-two white RF members against, with one RF MP deriding the African support as "based on misunderstanding." During another session in 1973 when one African MP denounced the Minister for Law and Order as enforcing "draconian, racialist laws", he was dismissed from the session by the Speaker for "not understanding the civility required in the House". In almost every major vote where the African members voted against an act, they were overruled by the white bloc.
This leads to the question of what impact the black MPs had. One long-serving but unnamed member of parliament for example, told Dickson Mungazi "I do not want to give the impression that we were a total failure because we accomplished some things for the good of Africans." Another, whom I interviewed in December 2015, claimed that "even if we did not force their [the white MPs] hands, we made them listen to the voices of the Africans in their country, even if they did not like what we were saying.." I think the question becomes how effective could the African MPs be when they were working within a white-dominated system which was fighting against their bretheren in the Nationalist Forces of ZANU and ZAPU? There is an argument that the presence of black MPs was further weakened by the insistence that half of all black MPs must be African chiefs or traditional authority figures. Because of this elevation and because of the fact that many of those appointed to parliament through "special appointments" by the RF state were those who had supported the state from a relatively early date, academics have argued that "the modern and progressive element of the African people is able to exert very little pressure in Parliament." [Weinrich, "Black and White Elites in Rural Rhodesia", p.218].
I hope this has helped. I think it should definitely be remembered that there were Black MPs in the Southern Rhodesian Parliament and the Federal Parliament also, but there are also still questions as to the influence they actually had on proceedings and whether their presence simply legitimised white rule by permitting the RF to point to these MPs and say "the African voice is being heard in Parliament". It is a complex history and a difficult one to delve into.