Margaret Thatcher, neé Roberts, (PROSE: The Assassin's Story) was the Prime Minister of the United Kingdom from 1979 (TV: Tooth and Claw) until at least 1987. (TV: Father's Day) According to one source, her predecessor was James Callaghan of the Labour Party. (AUDIO: The Oseidon Adventure) According to the Eighth Doctor, Thatcher served between Shirley Williams and John Major. (PROSE: Interference - Book One)
In March 1965, Lady Catherine Waverly believed that Thatcher, then in opposition, already showed a great deal of promise while Sir Toby Kinsella predicted that she would make her mark. (AUDIO: Manhunt)
In 1984, London Zoo had a female Tibetan Yeti named Mahamaya, which was successfully bred with a male from Peking. Their offspring was named Margaret after Thatcher, whom she bit at a photocall. (PROSE: Downtime)
The Sixth Doctor served as an advisor or consultant to her. He referred to her disdainfully as "that woman" and admitted that she terrified him. (AUDIO: The Ultimate Adventure) His tenth incarnation showed further distaste for her. (TV: Tooth and Claw)
In an alternative timeline, Thatcher was assassinated by her fellow Conservative politician Heathcliffe Bower in 1984. However, the proper timeline was restored by the Fifth Doctor. (PROSE: The Assassin's Story)
Behind the scenes
The reference to a female prime minister in Terror of the Zygons was an ad-lib by Nicholas Courtney, according to the DVD commentary for Frontier in Space. It could suggest that in the Doctor Who universe either Thatcher was elected PM earlier than in real life or that, as intended by the production team, the UNIT stories took place in the near future. The BBC's Doctor Who Classic Series website, however, claims that the Prime minister was Shirley Williams, with Labour taking over from a collapsing Jeremy Thorpe government.  In real life, Thatcher resigned as prime minister in 1990, but this has yet to be confirmed in the continuity of the franchise.
Margaret Thatcher inspired some unflattering portrayals in the Whoniverse. The misguided dictator Helen A from The Happiness Patrol is widely supposed to be based upon her, whereas the villainess Rehctaht, the female villain of Turlough and the Earthlink Dilemma, has the name Thatcher, spelled backwards.