Dr. Light built the entire MM1 cast, along with Blues, Rock, and Roll. Blues fucked off by himself. The six industrial Robot Masters were stolen by Wily for his world domination plot, Rock became Mega Man, Roll stayed home.
Going by series
MM2 were all built by Wily alone for his revenge quest
MM3 were a collaboration between Dr. Light and Dr. Wily, with Wily pretending he'd been reformed
MM4 were built by the Russian roboticist Dr. Cossack, who was blackmailed into helping Wily when his daughter was kidnapped
Mega Man V's robots were all built by an alien civilization, found by Wily, and promptly reprogrammed for fighting.
MM5 was all Wily's work alone; he also built several "Dark Man" Robot Masters in addition to the main eight, one of whom imitated Proto Man
MM6 were robots from all over the world stolen by Dr. Wily posing as a "Mr. X" , sponsoring a world robotics championship
MM7 was a mix of his original work and several stolen robots; Burst Man, Freeze Man, Cloud Man, and Shade Man were stolen and modified to fight.
MM8 also follows this trend; Tengu Man, Astro Man, Clown Man, and Aqua Man were stolen.
MM9 was all built by Dr. Light for the govetnment, Wily convinced them to let him reprogram and modify them when they were scheduled to be scrapped by tricking them
MM10's cast is from all over the world, akin to MM6, all were infected with Robozena.