No, Ditto can't learn just any move—its movepool is famously limited. In the games, Ditto is only able to learn moves like Transform, and in some titles a couple of others such as Taunt.
Its defining ability, Transform, is what makes Ditto special, letting it copy an opponent's form, stats, and moves in battle.