Where -and- how does 郭先生 mean dildo?
From what I could find,


「郭先生」is a Southern Chinese topolect word for「角先生」; I suppose that's believable as「郭」and「角」sound more similar in Southern topolects than northern ones (and they appear to be identically pronounced in Hakka). This makes「郭」a euphemism for「角」.
Folk etymology has「角」relating to dildo due to either


Dildos being originally made of animal horns, hence「角」;
Dildos being literally called ramming devices (觸器), and character explanations for「觸」are something like 从角蜀聲.



「郭」sounding like cock is probably a coincidence. Although the expression「角先生」seems to have arisen (or become more widespread) during the latter half of the Qing dynasty and according to dictionaries English was using cock as a slang for penis by that time, dildos existed for centuries before that, and it is unlikely that a word for dildo would come from British slang but wasn't first introduced by the British.

See also the Baidu article; CAUTION: NSFW, has a picture of a dildo on the top (all other sites trying to describe this seem to use the same explanations).