Ditto can breed under all circumstances, unless bred with a Pokemon in the 'No Eggs' egg group.
i.e. Here are the Pokemon that Ditto can't breed with.
Unless it's one of them, (or it's another Ditto itself) Ditto can always breed to produce a Pokemon of the opposing spouse's species. Or, in simple terms, the Pokemon being 'Ditto-bred'. :3
Hope I helped. :)
Source: EXP. ^w^