Does it turn into the mega evolution? Does it transform into the un-mega evolved form? Does it fail? Or does it do something else? (And if you need to test it, dont use showdown.)
I've seen it happen before. Ditto transformed into a Mega Gengar.
This video shows Ditto can Transform into a Mega Pokémon: http://youtu.be/_tbq8Hnl_mI