Periodically corrugated epitaxial graphene and hexagonal boron nitride (h-BN) on metallic substrates are considered as perspective templates for the self-assembly of nanoparticles arrays. By using first-principles calculations, we determine binding energies and diffusion activation barriers of metal adatoms on graphene and h-BN. The observed chemical trends can be understood in terms of the interplay between charge transfer and covalent bonding involving the adatom d electrons. We further investigate the electronic effects of the metallic substrate and find that periodically corrugated templates based on graphene in combination with strong interactions at the metal/graphene interface are the most suitable for the self-assembly of highly regular nanoparticle arrays.