That first appeared in TOS which was just a few centuries in the future. If TOS had been set thousands of years in the future, and if slower than light interstellar colonization went on for millennia before warp drive was invented, and if warp drive was very new in the era of TOS, they could have discovered many planets settled by colonists from Earth thousands of years ago. But the chronology of TOS and Star Trek in general does not allow enough time for many lost Earth colonies to be founded and be rediscovered.The tons of apparently human "aliens" on all these planets they run in to are actually humans from generation ships (or suchlike) who haven't been caught up on the "modern" era.
By theory is that the human-looking aliens didn't come from Earth after the invention of interstellar travel, but where taken from Earth by advanced alien societies such as the Preservers centuries and millennia earlier.