In BTTF1 the Doc of the past(1955) didn't believe Marty when he claimed to be from the future, and then he asked who'd be president in 1985 which Marty correctly answered with Ronald Reagan, who was back in 1955 a B-movie actor, so it was very unlikely he would ever be president. (Doc only believed Marty when Marty could explain how Doc came to the idea of the flux capacator, something Marty couldn't know unless he was really from the future having spoken with the Doc's future self). Trump was also a guy of whom nobody ever believed he'd become president someday until the day he actually became it (not even during the elections people thought he had a chance). Of course, in BTTF2 the president was never mentioned (as nobody could know who it would be, and especially not think about Donald Trump)... They did mention "Queen Diana" but back when BTTF2 was shot nobody could ever knew that Diana would have divorced Charles by then (making it impossible for her to be queen now in the first place) and even less that she would even ceased to be before that moment.
Oh btw... BTTF2's part in the future (the present was 1985, remember) was in 2015, in in 2015 Trump was not president, but Barack Obama still was, Trump was elected in 2016 (one year later) and began his term in 2017 (two years later). But if it was 2020 (and thus Trump being president already) the joke would be entirely complete with two men of whom nobody expected them to ever be president as president. (If they were good or bad presidents, was not my point).