Gog

Gog and Magog were two mythical beings, known in earth's mythology as giants. (TV: The Stones of Blood) "Gog and Magog" were names used in the Bible, while in the Koran they were known as Yajuj and Majuj. (AUDIO: The Feast of Magog)

Identifications
The Fourth Doctor speculated that the myth of Gog and Magog was inspired by the Ogri of the Nine Travellers. (TV: The Stones of Blood)

According to the Record of Rassilon, however, Gog and Magog were genuine primordial beings. They were given their names by Rassilon and listed among the Great Old Ones, whom Rassilon identified as members of an earlier race of Time Lords from a previous universe which had been destroyed. (PROSE: Divided Loyalties)

The Fourth Doctor himself also encountered a version of Magog in a parallel universe as the leader of the Malevilus. (COMIC: Doctor Who and the Iron Legion)

According to some accounts, the myths aboug "Gog and Magog" were based on the Gomagog, creatures that featured in the history and mythology of countless cultures across the universe (AUDIO: The Archive) who could possess other beings, and claimed to see everything, having watched over Earth since Humanity's ancestors climbed down from the trees. (AUDIO: The Feast of Magog) The Book of Magog said they came from "the space between the spaces, [...] conquering and ending all worlds in all universes". Some believed them to be a dark emanation of the Archive. (AUDIO: The Archive)