If you can arrange for something -- the hamster -- to put mechanical energy into the wheel, it's certainly possible to extract (electrical) energy from the wheel. Not much, of course, unless you have a large army of hamsters. And the energy is actually coming from the food you give them. Possible, yes. Practical, not really.