No,they are not the same Pokemon.Zorua and zoroark have Illusion as ability.
When a Pokemon with the Illusion ability switches into battle, it takes the form of the Pokemon in last place (6th) of the player's party. Illusion will not activate if the Pokemon in last place is the same species or is fainted.
Ditto can only learn transform as a move which transforms into the Pokemon which it sees.So if a Pokemon attacks ditto when it is transformed,it wont change back to ditto.