The health secretary denied the revelation – in a Dominic Cummings blog – was embarrassing, but declined to say if the pair had spoken about the text the prime minister sent.
The prime minister turned on his health secretary early in the pandemic last year, when Mr Cummings said his testing plans were in chaos and amid anger over the mounting death toll in care homes.
But Mr Hancock dismissed the attack as “ancient history”, telling the BBC: “At times of stress people say all sorts of things in private. What matters is how well you work together.
“And you’re referring to comments apparently from the prime minister. I work with the prime minister every single day. We work very strongly together, firstly to protect life, and secondly to get the country out of this.”
Watch: Matt Hancock not embarrassed by apparent 'hopeless' text message
Asked if it was embarrassing to have been called f***ing hopeless by his boss, Mr Hancock said: “No, it isn’t really because of all the things we’ve delivered together.
We’re here talking about the success of the vaccine programme. That is something that I’ve very much led from the department, working with the prime minister.
“He’s been a massive supporter of it throughout. And of course we’ve had obstacles, and we’ve had people that we’ve had to deal with on the way.”
In the interview, Mr Hancock also confirmed he wants regular testing to replace self-isolation for people who have been in contact with someone testing positive “as soon as it’s reasonable to do so”.
However, the testing would not replace self-isolation for people who have tested positive themselves.
Plans for an autumn vaccine booster programme would be set out in the next few weeks, as health leaders urge ministers to begin making preparations, Mr Hancock said.
And he rejected suggestions that it would take at least five years to deal with the backlog for NHS operations, saying: “I think we can sort it faster than that.”
The health secretary also insisted the government will publish a plan to reform social care before the end of the year – amid suggestions a meeting planned for tomorrow has been shelved.
In his revelations, Mr Cummings released a WhatsApp message revealing Mr Johnson called Mr Hancock “totally f***ing hopeless” for failing to meet a pledge of 10,000 daily tests by the end of March.
The prime minister also apparently told his aide that PPE procurement was a disaster, adding: "I can’t think of anything except taking Hancock off and putting Gove on.”
Watch: Five of the most important moments from Dominic Cummings' testimony