^I wouldn't expect a Star Trek/Doctor Who crossover to be in continuity with either series, so I don't see why that would be a consideration.
I'd like to include this story in my own personal continuity of both franchises, purely for the fun of it. I just love the idea that the Doctor might have met characters from Trek at some point.
Regarding how the crossover could have come about in-universe, I have a theory that the two realities of the Trekverse and the Whoniverse were somehow temporarily merged together to form a hybrid reality; this would explain how Whoniverse species like the Judoon and Slitheen could suddenly exist in the Trek galaxy. But what could have caused such a huge merger? I strongly doubt the Borg or Cybermen had such capabilities, so I suspect some higher power was at work, maybe Q, or Trelane, or the Celestial Toymaker.