Ditto can be seen has a breed machine as its only move is TRANSFORM(Search up)
But ditto can breed any pokemon with no gender,besides legendaries like Azelf,Keldeo,Zekrom (Link)etc.
But it can be paired up with any pokemon and it would breed it like normally.This is easy because the egg group does not matter in this case.For example u can breed Manaphy with Ditto and it would give you Phione.
So basically ditto is breeding machine.
HOW TO OBTAIN:Edit
DITTO CAN BE WON at the arcade(link) by buying it with 10,000 tix along with other rare Pokemon.Tix can be bought or won by playing games in the arcade.So ditto can be bought for 10,000 tix at arcade basically.Only way,since ditto CANNOT breed other ditto.