As we see in the Phantom Menace, it was Anakin Skywalker who first built C-3PO during his youth on Tattooine. Years later in A New Hope, Threepio (with Artoo) finds himself back on Tatooine and end up in the hands of Owen Lars and ultimately, Luke. Does C-3PO ever make the connection and realise that Luke is Anakin's son?
At the end of Revenge of the Sith, Bail Organa ordered that C-3PO's memory be wiped.
From Star Wars Wikia:
"I'm placing these droids in your care. Treat them well. Clean them up. Have the protocol droid's mind wiped." - Bail Organa, to Wedge Antilles
So given that, it's highly unlikely that C-3PO would have any chance of recognising Luke or linking him to Anakin.