hmmm, i think mew has dna of everything as the universe was created mew was too, but slowly mew started to adapt to their surroundings and they transformed to different pokemon, and in the end, there were very little mews and it became rare. this does mean that mew has the dna of ALMOST all pokemon except pokemon like arceus, dialga, palkia, and giratina, who were created before them (and im pretty sure noone knows the dna of those pokemon lol).
also a pretty cool theory, when team rocket tried to create mewtwo.one of their failed experiments was ditto, the ditto that escaped could transform as they had dna of all pokemon.