I would take it to a vet. It could be mites, but usually those are quite small and hard to see, hamsters can get worms to. The vet is your best option! I'm not even going to try and guess, if I guess wrong and you do as I suggest I would just hate it to be fatal to the pet. I wish you the best.
With respect you should really be asking your vet that question which he may be able to answer after an examination.