The Seventh Doctor first met Klein in the audio story Colditz. She was a scientist from an alternate time line, a version of the 1960s where the Nazis had won World War II. The Doctor erased that time line, but Klein became trapped in the primary time line. Eventually, the Doctor discovered her again, in A Thousand Tiny Wings, and took her with him. However, she stole the TARDIS and created multiple alternate time lines. In The Architects of History, the Doctor, with help from the Time Lords, repaired the damaged course of time and erased Klein from history. Afterward, he visited Klein - the version who was raised in the primary time line - who had no recollection of her alternate life or travels with the Doctor. This new current version of Klein works at UNIT as their Scientific Advisor, a position previously held by the Third Doctor.
Klein says the German name Johann seemed very familiar. This is a reference to the pseudonym an alternate version of the Eighth Doctor used to trick the original version of Klein.
Raine travelled with the Seventh Doctor and Ace in the Lost Stories audios, starting with Crime of the Century. The Doctor met her parents in the previous story, Thin Ice, where he helped deliver Raine. UNIT: Dominion takes place a long time after those stories, from the Doctor's perspective, but for Raine, who has spent little time with him, this story takes place between Animal and Earth Aid.
Ace's voice is heard briefly, warning the Doctor from Gallifrey. How or why she is there is not explained, however, the producers of the original television series planned to take her there as part of her departure story. The intention was that the Doctor wanted her to be educated by the Time Lords, but that story was never told, due to the cancellation of the series in 1989.