History and specifics
In the year 1986, Montgomery Scott told Doctor Marcus Nichols that he was a professor who had come from Edinburgh for the express purpose of touring Plexicorp. He claimed that the city was located millions (rather than thousands) of miles from San Francisco before being corrected by Leonard McCoy. (TOS movie: The Voyage Home)
The Caldos colony was patterned after Scotland and aimed to recreate the country as accurately as possible. As such, several of the cornerstones of buildings had been transported from locations such as Edinburgh. (TNG episode: "Sub Rosa")
In an alternate timeline accidentally created by Leonard McCoy saving Edith Keeler's life in March 1930, the United Kingdom was conquered by Nazi Germany prior to 1944. A Nazi occupation force arrived in Edinburgh shortly afterwards and was met with little resistance.