Yes hydrogen peroxide is a very good treatment for getting rid of and treating ear infections.
Another good use for hydrogen peroxide for your ear is getting rid of ear wax build up.
If you want to remove some stubborn ear wax just put some hydrogen peroxide on the earwax and it will wipe out of your ear.