I know you get at the end of a forest like thing. But I found one when I accidently wandered into the grass (at the end of the forest like thing).
They are not very rare in the Pokemon village.
They have a 50% chance of appearing in purple flower patches.
They have a 75% chance of appearing in yellow flower patches.
Ditto can also appear in a Friend Safari along with Chansey, Eevee, and Smeargle
Hope I helped!
In the purple flowers, it is a 50% chance of seeing a ditto.
In the yellow flowers, it is a 75% chance of seeing a ditto.
So not really too rare.
Also , Ditto can't be found anywhere else (from Pokemon village) , except friend safaris, where it is a 25% chance. Unlikely, but still not rare. Ditto wouldn't be too difficult to get in XY.