Yes, though bleach would probably be better. (Don't leave the hydrogen peroxide on the diaper, rinse it off).
Try 1/4 cup bleach, 1/4 cup dishwasher detergent (like Cascade) mixed together in hot water in the sink or pail. Then put in the diaper for 15 minutes and wash immediately after that. This works for formula and other stains, too. It originally was a hint from Heloise and I've used it frequently for the past few years.