However no one ever asked that question of a sitting president until 2016 (EDIT: 2020), so the sample size is essentially one.
And while a sitting President has never expressed this, there have been a number of Presidential hopefuls or their supporters that have disparaged or at least contested results.
In 1824, Jackson lost to Adams in the House contingency election, despite having more popular and electoral votes. Jackson and his supporter called it the "corrupt bargain" and throughout Adams's term, attacked him as an illegitimate President.
This election saw widespread violence, fraud, and other illegitimate assault on democracy. Democrats lost by one vote and threats were made against Hayes' life.
Tilden never conceded defeat:
I can retire to public life with the consciousness that I shall receive from posterity the credit of having been elected to the highest position in the gift of the people, without any of the cares and responsibilities of the office.
In 2000, Gore conceded the election, and then revoked his concession.
He and Bush then fought a bitter legal battle for weeks over the Florida vote, involving multiple recounts and eventually the Supreme Court. Gore disagreed with the conclusion, but accepted it.
Let there be no doubt: While I strongly disagree with the court's decision, I accept it. I accept the finality of this outcome which will be ratified next Monday in the Electoral College. And tonight, for the sake of our unity of the people and the strength of our democracy, I offer my concession.
In 2016, a number of prominent scientists and lawyers discovered statistical anomalies in the vote. Citing their evidence, Green Party candidate Jill Stein filled for recounts in Wisconsin, Michigan, and Pennsylvania. #Recount2016.
The DNC filed a federal lawsuit claiming foreign tampering in the 2016 election:
In the run-up to the 2016 election, Russia mounted a brazen attack on American Democracy.
Russia then used this stolen information to advance its own interests: destabilizing the U.S. political environment, denigrating Democratic presidential nominee, and supporting the campaign of Donald J. Trump
Democrats claimed Trump conspired with Russia to upend American democracy and win:
Over the course of the last year we have seen, I think, a mountain of evidence of collusion between the campaign and the Russians to basically affect our democracy - DNC Chairman Perez
In 2020, previous candidate Clinton said of then candidate Biden:
Joe Biden should not concede under any circumstances because I think this is going to drag out, and eventually I do believe he will win if we don't give an inch and if we are as focused and relentless as the other side is.