@vicky_molokh-unsilenceMonica It started as a simple coincidence. When the fandom gave him the Doctor Whooves nickname, the show writers decided to play on the reference.
Anyway, the plot of the comic isn't probably that relevant for your original question, so I will just skip it and focus on the mirror.
As I said, the first mirror is mentioned in the comic as a device made by Star Swirl to explore alternate worlds. For some reasons the worlds were altered versions of the original one.
In the image before you can see the "My Little T-Rex" world. Yep, that one is Flutter-rex.
other included steam-punk versions and so on.
The cover of the comic, it is about one of those world where every character basically has a negative. So the mane six in there , evil.
The original mirror was sealed because of an argument Star had with Celestia. A thousand years later it is found again by Twily and the plot of the comic starts there.
But that wasn't the only mirror. A second mirror was made, and that was the one Sunset Shimmer used. That mirror sent Sunset - who was a pony and the original student of Celestia before Twily (if the comic is to be taken as canon, she is also a little older apparently) - to an alternate dimension were every pony had an human counterpart.
That is the world EG is set in.
Now, in the first movie the pony Twilight travels to that world and takes an "human" appearance as a result. Sunset Shimmer is the main antagonist.
Second movie... still pony Twilight called back by Sunset, who was "reformed" at the end of the first movie (notice, if the reforming sound stupid, the reason she was "evil" before is even more stupid. Again, a case of "had you talked before...")
The pony-as-human Twily... she feels out of place for the whole first movie, starts to get used to it in the second one.
in the meantime, she tries thing like kicking a vending machine, hoping an apple will fall down (see: Applejack)
At the end of the second movie, past the end credits, you briefly see a second Twilight in the human world.
That is the human Twilight, which is often called "Science Twily" or "Sci-Twi" because in her first appearance she is wearing a lab coat.
And.... this one replaces the pony Twily as the protagonist of the following EG movies and short episodes.
(the pony version still makes some cameo)