Background
The Masaki Shrine is near Masaki Village and the family home of Tenchi Masaki in rural Okayama, Japan throughout all of the many Tenchi Muyo! metaseries.
Tenchi Muyo! Ryo-Ohki (OVA)
In the official continuity, the shrine is where Prince Yosho Masaki Jurai trapped the space pirate Ryoko after landing on Earth following the battle of planet Jurai. He took on the name Katsuhito Masaki, became its Shinto priest, and guarded the shrine for 700 years until he tricked his grandson Tenchi into releasing Ryoko in hopes that he would take his place on Jurai. Afterwards, it is still used as a place of worship.
Tenchi Universe
In the Tenchi Universe continuity, the Masaki Shrine is still the place where Prince Yosho settled after arriving on Earth from Jurai. Instead of being a prison for Ryoko, it was a prison for Washu Hakubi, who, in this continuity, was a mad scientist with the means of destroying countless planets and was sealed in a crystal prison and shot into space by the Galaxy Federation. It eventually landed on Earth and the shrine was built around it. Upon arriving on Earth, Yosho recognized that the "goblin" inside of the shrine was Washu and decided to be trained by the Masaki family to become its guardian. Once again, he took the name Katsuhito Masaki.
Tenchi in Tokyo
In the Tenchi in Tokyo continuity, the shrine is simply a place of worship. Tenchi moves to Tokyo in order to train to take over as the priest/guardian of the shrine. The shrine was not a prison for anyone until the end of the series where Tenchi placed the sleeping antagonist Yugi who would sleep there until she reached a maturity where she could control her various powers.
Trivia
- While there is a Masaki Shrine in Okayama Prefecture, Japan, the shrine in the various Tenchi shows are modeled after the Tarojinja shrine, in the city Asaguchi, also in Okayama. The shrine was one of the earliest spots to inspire real world anime pilgrimages for fans of the series.