There is no proof Daniel was Samuel's father (or indeed he wasn't Samuel's father). If Samuel's mother was no longer living with Daniel for whatever reason and she had a relationship with someone else of whatever length, Samuel could be the product of that relationship (a valet passing through the area, met while both were working as servants)?
If Samuel wasn't a Harris (though legally that was his mother's name so would be his) he reverted to his mother's family's surname. Or if Daniel was his father he rejected any association with the Harris surname for whatever reason. There is no evidence Samuel's father's surname was Cox, and there is no evidence his father's name was Samuel - other than the marriage certificate (and marriage certificates are one of the most fabricated records there are, and should never be trusted without further evidence to back them up).
On Samuel's marriage he would want to appear legitimately born, so his father's surname would have to be the same as his own to dispense with any awkward questions or assumptions. Samuel might have been his father's name or he might have just put his own name for convenience. If he was rejecting any association with Daniel Harris he wouldn't want him named.
If Samuel was in fact his father's name he could have any surname, Samuel Smith, Brown, etc etc. There is no evidence as yet and that would be evidence at the time of Samuel's birth (bastardy order - quarter sessions records - where maintenance was claimed) that Samuel's father's surname was Cox, or any other surname other than Harris.
Samuel Cocks (1851,1861 and 1871 census spelling - 1841 census spelling Cock) was in Surrey on the 1851 and 1861 censuses and Aldershot Hampshire in 1871. His first child was born in Berkshire circa 1847 by the birth of his third child circa 1850 he was in Surrey. He was a grocer in 1851, a baker and beer house keeper in 1861 and a baker in 1871. He was an apprentice grocer in Great Marlow in 1841 but appears to have left Marlow permanently after his marriage in 1846.
Marriages Mar 1846
Cocks Samuel Wycombe 6 529
Flint Rebecca Wycombe 6 529
He died in the Aldershot area in 1897
Deaths Mar 1897
Cocks Samuel Charles 75 Farnham 2a 68
Samuel actually gave his father's occupation on his marriage as a valet - not a baker like Daniel Harris in 1841 (though people change occupations so it doesn't in itself rule Daniel out).
Regards
Valda