Tim Kaine, who ran on the Democratic ticket with Mrs Clinton, recalled the exchange during a meeting with Clinton that was caught on camera in 2016.
Kaine said: "President Obama called me last night and said: 'Tim, remember, this is no time to be a purist. You've got to keep a fascist out of the White House.'" Kaine then laughs, adding that Obama "knows me and he knows that I could tend to err."
Clinton replies, nodding: "I echo that sentiment." She then puts her hands to her chest and says: "But that's really -- the weight of our responsibility is so huge."
The clip appears in an episode of Hillary, a four-part documentary series that comes out in the United States in March. The series chronicles Clinton's life and political career.
Nanette Burstein, who directed Hillary, confirmed to NBC that the clip of Kaine was recorded by a camera team hired by the Clinton campaign.
The date and location of the conversation are not known.
Obama has rarely publicly attacked Trump since leaving office. In 2016 he warned the Democratic National Convention that "homegrown demogogues" - which was interpreted as a comment about Trump, then the Republican presidential nominee - were a threat to the US.
The former president has also criticised some of Trump's policies, such as pulling out of the Paris climate agreement, and his use of Twitter.
NBC said that Obama's communications director declined to comment about the documentary, while Kaine and Clinton did not respond to requests for comment.
The documentary made headlines this week after The Hollywood Reporter said the series featured clips of Clinton attacking Bernie Sanders, her opponent in the 2016 Democratic primary battle. Clinton said Sanders was a "career politician" who "nobody likes"
"He was in Congress for years," Clinton said. "He had one senator support him. Nobody likes him, nobody wants to work with him, he got nothing done. He was a career politician. It's all just baloney and I feel so bad that people got sucked into it."
The documentary is expected to feature Clinton's role as first lady and President Clinton's affair with Monica Lewinsky.