I’ve learned to never say never when it comes to writing, usually because saying “never would” becomes an inducement to do just that. That said, involving a real person based fanfic would have a certain level of ick to it, likely invite lawsuits depending on what you’re depicting, so probably best avoided.
REFERENCING a real person, can be alright though. JKR famously put Rupert’s first name into HBP (when Slughorn was trying to remember Harry’s friend’s name…). I’ve had Harry visit Graceland, so the name of Elvis comes up. Also when I wrote about my Harry getting a flood of hate mail, I put some addressed to the actor’s name with “Who’s …?” I’ve also loosely based some characters on real people before (won’t give names).