Hydrogen peroxide is okay to use to clean your dog's ears because it doesn't sting like something like rubbing alcohol would.
There's a great step-by-step video on how to clean the ears here: http://www.youtube.com/watch?v=99x64TF8ppU , and when the vet says to use a 'cleaner', that's when you'd use the peroxide instead.
It's important to remember, however, that if your dog has dirty ears, with wax or debris in them, or if the ears are red, inflammed or smell bad, it could be an infection, and simple cleaning won't make it better. If the dog does have an infection, he'll need antibiotics to get it cleared up.
I hope this helps.