I heard rumours that my grandfather William Balshaw deserted in WW1 and ended up in Cape Town, South Africa in 1917 where he took the name of Selby. Where can I find the records of WW1 deserters?
You don't say where your grandfather came from, so I will answer based on the assumption that he was from the UK.
There is no central list of those who deserted during the war. The first place to check for a particular individual would be in their First World War service records.
If your grandfather served in the British Army, then that might be a problem since many of those records were destroyed by enemy bombing during the Second World War. Those that do survive have been digitised and are available from several genealogy search sites (you will usually need a subscription to view them). There is a useful guide on greatwar.co.uk.
The UK National Archives has a page of useful links for locating other types of Army records, and also the records of those who served in the other services.
To give one example, there are medal cards for at least 9 William Balshaws (there may be others listed as variations such as "W. Balshaw" etc.). If any of these were known to have deserted, that fact might be noted on the card (as a reason the medals were 'forfeit'). You could then check the associated medal roll to see if any further details were recorded.
Of course, you would also need to verify other details to confirm the card you have found is actually for your William Balshaw!
The next place to search would be listings of deserters in local newspapers and in the Police Gazette. The Police Gazette is available to search on the British Newspaper Archive website (as are many local newspapers). You can search for free, although viewing the results requires a subscription (many local libraries and archives in the UK offer this facility free to local residents along with subscriptions to Ancestry or FindMyPast).
Finmypast has a searchable collection British Army, Deserters and Absentees In Police Gazette 1914-1919. Although I didn't get a hit for "William Balshaw", it may be worth trying with any spelling variants you can think of since transcription errors in these digitised collections are far from uncommon!
Local libraries and archives may also hold collections of local newspapers that are not (yet) available from the British Newspaper Archive.