Terriers were bred to chase and fhunt rodents. I don't think that you'll have very much success at teaching these 2 to get along. Beleive me, I've had tons of animals and tried to get so many to get along with rabbits, hamsters, birds, guinea pigs, hedge hogs. The best dogs I've ever had that get along with the animals are my 2 maltese mix dogs, my poodle and our chow that we used to have.

I'm not saying every every dog of those breeds will be good with animals, but mine were. I'd make sure I never left the dog and the hamster alone. He might hurt it by just trying to play with it, but you never know.