also, is it different in OR/AS?
Mega Evolution and Dynamaxing generally occur at the beginning of a turn but after any switching has occurred; however, if a Pokémon is Mega Evolving or rotating in and then using Pursuit on a Pokémon that is switching out, the Mega Evolution or rotation always happens before the Pokémon uses Pursuit (and therefore before the other Pokémon's switch).
source So according to Bulbapedia, mega evolution's order wasn't different in gen 6, even though they did change the order that Pokemon use moves immediately after mega evolving.