Peter Calvocoressi, who worked at Bletchley Park as an Intelligence Officer, was surprised that, as a Greek, he was allowed into secret Intelligence work. He had been rejected by the Diplomatic Service in 1934 because he was not the son of British-born parents. However, this did not debar him from joining the RAF in 1942, and being sent to Bletchley for the rest of the war.
As laid down in 1932, Foreign Office rules required that applicants be ‘natural-born British subjects’ or from ‘the self-governing Dominions’, i.e. Canada, Australia, New Zealand, and South Africa. However, as Calvocoressi’s experience shows, the pressing needs of wartime produced some relaxation – it became possible for foreigners to work at Bletchley, and indeed Grey (Decoding Organization: Bletchley Park, codebreaking, and Organization Studies, 2012) mentions staff being drawn from North America, the British Commonwealth and Europe. Note, however, that these would be almost exclusively white, and either English-speaking or European. The recruitment net was not cast so narrowly as to ensnare none other than white Britons, but neither was it cast widely enough to bring in talented staff from a wider range of ethnicities. As late as 1956, as Ferris observes, GCHQ ‘saw no institutional reason to hire non-white subjects’ (Behind the Enigma, 2020).
This blinkered racist view did not prevail in the same way in the USA. Although full voting rights were withheld from the majority of African-Americans (and other ethnic minorities) until the legislation of 1965, General Cooke, chief of cryptanalysis in the US Army, was instructed in 1944 to hire about 100 black individuals and give them meaningful crypto work. With the help of his messenger, William D. Coffee (1917-1989), he established the first segregated unit of black cryptologists, responsible for identifying codes, decoding, translating, and routing commercial coded messages from a wide variety of countries.
William D. Coffee led his cryptologic unit with distinction during the closing stages of WW2. His strength of character brought dignity to African-Americans in cryptologic work at a time when discrimination was still officially sanctioned, and he (deservedly) reached a status previously beyond the reach of African-Americans.

William D Coffee receiving an official award for cryptographic work from General Preston Corderman.