In the 60s and 70s, the people in Hong Kong call those brown hairs and/or blue eyes foreigners "GHOST". Because they look different. The man is called 鬼佬, woman is called 鬼婆, girl is called 鬼妹and the boy is called 鬼仔.In general, they are being called ghosts. The HK people thought that they are more intelligence than those ghosts, they always try to create some slangs to insult the foreigners, 鬼 is the insulting word.
厄鬼吃豆腐 is to insult the person with lower IQ, he/she is very easy to be fooled.