Here's something I've been curious about. How many pre-existing Science Fiction stories have been adapted into Star Trek episodes?
TOS: "Arena" was nominally adapted from Fredric Brown's story of the same name, although it's a bit more complicated than that; Gene L. Coon wrote the episode without realizing he'd been subconsciously influenced by Brown's story, and once the researchers pointed that out to him, the production contacted Brown and bought the rights to the story. So that's a borderline case.
TAS: "The Slaver Weapon" was adapted by Larry Niven from his Known Space novella "The Soft Weapon." It's an extremely faithful adaptation of the original.
TNG: "Tin Man" was adopted from the SF novel Tin Woodman
by its authors, Dennis Bailey and David Bischoff, with an uncredited Lisa Putman. (Well, semi-credited; the rules at the time only allowed two credited writers on a team, so Bailey had himself billed as Dennis Putman Bailey even though his real middle name is Russell.)
Those are the only ones adapted from pre-existing, published original SF stories, as far as I recall. However, TNG: "Where No One Has Gone Before" was very loosely based on Diane Duane's TOS novel The Wounded Sky
-- at least Duane and Michael Reaves's first draft was, but the producers rewrote it to the point of having very little in common with the novel beyond the basic situation.
I personally think a re adaptation of Fantastic Voyages would have made a pretty cool TOS episode. It came out around that era but it would have fit well into TOS.
Adapting other film or television
tales? That would never work, because there's direct competition there. I don't see why any movie producer would agree to let a TV show adapt the plot of their movie and risk losing revenue to a competitor. Sure, you could do a pastiche, as long as it weren't close enough to get you sued. Kenneth Johnson did this a lot; the villain in his The Bionic Woman
episode "Doomsday is Tomorrow" was a knockoff of HAL from 2001
, while his "Prometheus" for The Incredible Hulk
borrows considerably from The Andromeda Strain
. But actual adaptation? It would have to be from prose sources.