By general consensus, the best episodes of TOS and TNG are, respectively, The City on the Edge of Forever and the two-parter The Best of Both Worlds. The former takes place mostly on Earth, while the latter concerns a threat to Earth and reaches its climax in the immediate vicinity. Hmm.
And I'll add that a part of The Cage
--the very first Star Trek
episode ever made--took place on Earth, during one of Pike's illusions.