A famous glitch in Pokémon Gold and Silver can be used to Transform a Ditto into a Smeargle, allowing it to use Sketch to permanently gain an attack used on it. Ditto can then breed the attack into its (non-Ditto) offspring. In Pokémon Emerald and similar games of the generation where Ditto and Smeargle appeared, this was fixed, meaning that a Ditto using Sketch will always fail and a Smeargle will find it impossible to Sketch Transform.
Look Here as Well.
Otherwise, it would just Transform into Smeargle and it will be a endless battle until one or the other runs out of PP, then it'll be Strugglin' Madness.