So, Fugitive of the Judoon. Given the title, the quantity of "fan-trolling continuity porn" (as one writer put it) wasn't a massive surprise. The handling was hit or miss; invoking the Chameleon Archwas pretty neat; on the other hand, Barrowman played Captain Jack with all the subtlety of the moral of Orphan 55. (The story was pretty much irrelevant, of course.)
Anyway, the big question for me is, where does Doc Martin fit into the timeline? I've seen alternate timeline put up as a possibility, but in that case, there's no real mystery as to why Thirteen doesn't remember her, so I'm assuming that's not it.
The main piece of evidence is DM's TARDIS design. The console is the design used by the First and Second Doctors. Obviously you could slot in Doc Martin before the First Doctor. There's very little we really know about their past. It would be a bit strange though, specifically having the Doctor working for some kind of military group. I don't see a straight line from Doc Martin to William Hartnell's character.
Alternatively, there's this peculiar fan theory that's been rattling around since at least the 90s, I think - Season 6B. Season 6 was Patrick Troughton's final season. It ended with The War Games, which ends with him captured by the Time Lords (their first appearance since the show began), to be forcibly regenerated and exiled to Earth (and thus begins Season 7). Simple enough; but there were some discrepancies. In The Three Doctors, The Five Doctors and The Two Doctors, the Second Doctor is carrying the Time Lords' water. In The Five Doctors, he knows the Time Lords wiped his companions' memories. In The Two Doctors, he and Jamie are visibly older. (Apparently "it's fifteen years since they were series regulars and the actors are human" isn't sufficient.)
Solution! In between his trial and sentencing, and regenerating into the Third Doctor, the Time Lords' Celestial Intervention Agency (yes, seriously, the CIA - it's canon, it gets mentioned in the Fourth Doctor adventure The Deadly Assassin) co-opt him to act as their agent for a spell (with his companions returned to him). Neat! And utterly daft, but fans can come up with all sorts of things.
Until the BBC published the novel, "World Game". In which the whole Season 6B malarkey plays out, in a book with the BBC logo on it. And it written by Terrance Dicks. Dicks, the show's longest-running script editor. He was script editor and co-author of The War Games. He commissioned The three Doctors. He wrote The Five Doctors. He novelised 64 televised adventures, wrote thirteen original novels. He is no fringe player, and he was heavily involved at the time.
So here we have a theory for Doc Martin - she's Season 6C. Eventually the Doctor skips out from his CIA tether, regenerates, uses the Chameleon Arch and hides out in Gloucester. Simple! It's not perfect; she seemed not to recognise the sonic screwdriver, but it first appeared in the Second Doctor adventure Fury from the Deep. But it does have the great merit of being just as bonkers as introducing Doc Martin in the first place.