Stargate

Stargate SG-1 and Stargate Atlantis are two Continua that are part of the same Canon universe.

Stargate SG-1
Exceedingly fast interstellar travel in this 'verse is possible by use of 'stargates', ancient devices made by aliens which form a network between various galaxies. The story follows SG-1, a team of military explorers who are exploring, finding new technology and making contact with aliens in order to defend against a parasitic alien race.

Stargate Atlantis
SGA is a spinoff of SG-1 in which humans take an expedition to Atlantis in the Pegasus galaxy, where they try to unravel the secrets of the Ancients. Their principal enemy is the Wraith, a hive-like alien species that feeds on humans.

In badfic
There are several possible varieties of Mary Sue in Atlantis. One is the (often teenage) female that is native to the Pegasus galaxy. She could be a runner like Ronon or a relative of Teyla.

The other option is a woman or girl sent from Earth to Atlantis. This also comes in two varieties: the girl in question has no one left on Earth to take care of her, but there is a relative on Atlantis. The unlikelihood of a child from Earth being sent to live on a top-secret base in another galaxy on the front line of a war is forgotten in the face of the Sue's powers, and there are many canon males, all at least twenty years her senior, for the Sue to fall in love with.

In the second variety this problem is at least tackled, as the Sue is giving a military rank. Often her rank is too high for her experience, or behaviour. These military!Sues often don't seem to know the first thing about the concept of following orders.

In badslash, Colonel Sheppard and Doctor McKay get it on. Repeatedly. Their canonical appreciation of women, and such minor difficulties as the impracticability of screwing up or down the chain of command and the DADT policy, are forgotten in favour of sexytimes. In mpreg, Sheppard is occasionally turned into a woman by Ancient machinery, but more often the Ancients inexplicably had machines to give men wombs in their rectums.