So lets say he was born two years before his parents married in 1825
I wouldn't think that Thomas was necessarily his biological father. It's more likely that either Ann was previously married or - more likely - that Robert was her illegitimate son
If Thomas brought him up - he probably adopted the Dexter surname when he married whilst retaining his birth surname as his middle name
If he was born within a legitimate marriage - he may not have adopted the Dexter surname - but that's just a personal opinion