Wasn't there a Dr. Who comic in which the Doctor meets Stalin and ends up saying that history would misremember him lmao
Edit: found it. Was a short story. https://tardis.fandom.com/wiki/Closing_the_Account_(short_story)
Summary:
Josef, who has been the president of his country for several decades, is dying. He wants the Doctor to visit him, so he captures Ace.
As Josef and the Doctor talk, Josef reveals that he has noticed a few things about the Doctor. Though they have met several times, and the last time was twenty-five years ago, the Doctor hasn't changed or aged. In addition, when he comes and goes, there is always a blue box involved.
Josef has deduced that the Doctor can see the future and wants to know what his legacy will be. The Doctor tells him that for over a hundred years, people will vilify him, but after that, people will realise that his actions, though sometimes wrong, were the right thing to do and they will continue his work.