If I am not mistaken - JRT's were bred to hunt rodents!

Chances of every having them be "friends" would be pretty slim. You might consider putting the hamster cage on a dresser or bookshelf where your pupper can't reach. Maybe in a room where you can shut the little terror (sorry, I meant terrier!) out so that the hamster can run around in a ball or whatever.