I know that it is not just dogs and cats that can be litter box trained. Some other pets like rabbits are pretty easy to train so can you litter box train a hamster? If so how?
Litter training a hamster is possible, though often hit or miss as they are not the most intelligent creatures on the tree of life. Some are receptive to training, others not.
You should notice that your hamster naturally urinates in a certain area, whether it be a corner of the cage or a box you originally bought as a sleep box, in which case that is where you should set up the litter box/hut/jar/recepticle of your choice. Most hamsters however cannot be trained to poop in their box, they're generally a poop-as-they-go animal. Even if they only urinate in the box, it is still very helpful in reducing odor and cleaning time. There is a guide here which explains about choosing a litter tray.
There is also an instructional video here.
There is much discussion about which litter is best for a hamster, but in general as with all rodents it should be dust-free to avoid aggravating their sensitive respiratory systems. Chinchilla sand is preferred by some users, others go for paper based cat litter, others use plain newspaper or toilet tissue. It depends which your hamster prefers, but it must be sufficiently different from his regular bedding that he doesn't get confused between the two.