Public figures aren't copyrighted the way song lyrics are, so you can certainly refer to them. There are issues of possible defamation, though maybe the line is more blurry for really famous people and politicians? After all, they are attacked, slandered, and the subject of numerous conspiracy theories and blatant falsehoods in real life, and their ability to sue seems limited.
I think there's a risk with referring to someone whose history isn't "finished,"however, because in a few years the work could become highly dated. If you have something, say,premised on Elon Musk founding a space colony and becoming a hero in the future world, but in five years from now he is sentenced to life in prison for murder, it will definitely "date" your work. It's probably safer, for that reason, to create characters in your universe's past that resemble our contemporary personalities but aren't them. Unless political satire is your goal.
Once someone has passed on and their legacy and personal foibles are recorded for posterity, I think it's safer to use them as historical references. We all know where Henry Ford and Edison and Curie and Nixon (just a few examples) ended up in history by now, and that's less likely to undergo dramatic revision in the near future.
There is also the issue of possible defamation, of course. If you create a world built on the assumption that Elon Musk committed massive fraud in our own near future. I'm not sure where the lines is there regarding defamation. There are works that poke fun at famous people via references to personalities or characters with different names but are clearly based on a real person. And the Simpsons Riff on real-life people all the time. There was even an episode back around 2000 with a reference to Donald Trump having eventually been POTUS and leaving the country in a mess (for future POTUS Lisa to clean up). But being a satiricalwork probably gives one more latitude (even if some hyperbolic predictions turn out to be more true than their author thought they would).
I do not think there is any rule or law that would prevent one mentioning a still-living contemporary figure in one's work, however. I've noticed that many authors tend to avoid this, though not all do.
Note I am not a legal expert, so I don't know where the line is with regards to a work of SF that is less than laudatory about a person who is still alive right now.