Hi,
It's possible your hamster has a urinary tract infection. When they do, they tend to drink a lot, urinate a lot, and sometimes there is blood in the urine. The urine tends to be very smelly, too. If your hamster does have a UTI, he may be getting urine on his underside, and that's what's making him smell.
You need to take him to a vet to confirm it's a UTI, and for treatment with antibiotics if it is.
Let me know if you have any other questions.
Susan