I found a answer to your question on this site:
This is what it said.
Hamsters also get fleas. You can use a Carvrill-based flea powder just like you do in cats and dogs no flea product is made exclusively for hamsters. Powder them very lightly.
Remember that hamsters groom themselves, so you don't want to leave a lot of powder on them to ingest when they groom. Three tiny pinches is all you need. Work it into the fur over their entire body.
Treat their living area, too. If you have dogs or cats in your home, they will need to be treated as well. Dogs and cats can pass fleas on to hamsters.
I don't if you want to try it but if you do, I hope it works.