When Mega Man is fighting Galaxy Man in space, he ends up crashing. Somehow, Galaxy Man runs out of fuel at the same time. Coincidentally, they are right above Equestria. When they land and survive, Mega Man goes off to investigate this land. However, Galaxy Man still has contact with his fellow Robot Masters.
Credit to Waffle2789 for helping.