There are a few instances where there is an explanation. In Star Trek VI, Michael Dorn plays Colonel WorfColonel Worf, not to be confused with his 24th century counterpart24th century counterpart. While never stated onscreen, Memory Alpha confirmsconfirms that the writers intended for Colonel Worf to Next-gen Worf's grandfather. The likeness between the two characters (most notably in their voice) is therefore explained by familial connection.
The same is true for Tasha Yar and her half-Romulan daughter Sela, both played by Denise Crosby.
Also, bit of a cheeky afterthought, but Jonathan Frakes plays both William RikerWilliam Riker and Thomas RikerThomas Riker, who are transporter duplicates. My personal pet hypothesis is that characters played by the same actor are in-universe duplicates of each other due to time travel or some other techno-nonsense. But obviously that struggles to explain characters of different species.