Where can you find a master ball?
You get a master ball either from your cheats if you have any or else you get a master ball from the boss of team galactic (cyrus when you beat him in head quarters).(This answer is for Pokemon Diamond and Pearl).
You find the master ball in the center of Team aqua's lilycove hideout with 4 other balls 2 of them happen to be level 30 electrobes. In order to get a master ball, you have to get through the team Aqua hideout. In one room, there are 4 balls. 2 of the balls are Electrodes, one is a nugget and the other one is the master ball.