Georgina Edmonds, 77, was found dead after being tortured at her home near Eastleigh in Hampshire in 2008.
Matthew Hamlen, of nearby Bishopstoke, told the court he was "not an expert" but said if DNA found on the blouse was his "it didn't get there at the time".
Mr Hamlen, 36, denies murder in the trial at Winchester Crown Court.
Prosecutors claim DNA found on Mrs Edmonds's clothing and on the rolling pin was that of Mr Hamlen.
He was asked: "The matching results are approximately 26 million-times more likely if the DNA has originated from you, than if it is from someone unrelated to you - how did it get there?"
Mr Hamlen replied: "I know I didn't do this, I could not do something like this.
"As far as the DNA goes, I'm not an expert. All I can tell you is, it didn't get there at the time, if it is mine."
The jury was previously shown CCTV footage of a man in a high-visibility jacket attempting to withdraw money with Mrs Edmonds's debit card on the day she was killed.
When asked if it was him in the images, Mr Hamlen replied: "No."
During cross-examination, the defendant was also asked about his relationship with his partner at the time of the killing.
He admitted it had not been good, that his partner had been violent, and he told police in an interview that during one incident he hit her around the face with an ironing board "a few times".
The 36-year-old is on trial for murder for a second time after being acquitted of the same crime in 2012.
The trial continues.
A man accused of beating a pensioner to death with a marble rolling pin has cast doubt over the reliability of DNA evidence found on the victim's blouse.