People often make the mistake of assuming that if two stories resemble one another, one must have deliberately copied the other. In fact, nothing could be further from the truth. It's very hard to avoid
telling a story that resembles some earlier story. Perhaps the most common reason why story pitches to TV shows or submissions to fiction magazines get rejected is "We're already doing one like that." Which is why writers usually try very hard to avoid imitating other stories. Any similarity you do come across is vastly more likely to be accidental.
And there are more episodes of Star Trek
, cumulatively, than just about any other SF screen franchise except Doctor Who
(and surely a lot more distinct stories, since most of DW's episodes were parts of multi-episode serials). It's thus pretty much impossible to find a story that doesn't bear some similarity to some previous Trek episode. It's not proof of imitation, it's just statistics.
Every story has been told before and will be again. That's just the nature of stories. Stories work because they have meaning for human beings, and the number of ideas that carry meaning for us is finite. A story based entirely on ideas no human being had ever written down before would be so alien as to be incomprehensible. All stories are built on pre-existing ideas -- ideas the writer is aware of and wants to engage with, ideas the audience will understand and relate to things in their own lives. What matters, what makes them fresh and original, is how those ideas are put together and expressed.