No doubt hamsters are prone to getting cancer but it is not always true. Male hamsters are more vulnerable to cancer than female hamster. Sometimes hamsters develop lumps and bumps that are mostly present under the skin and feel hard when touched. One of the symptoms of these non malignant cells growth is that hamsters usually chew on them. These lumps are simply drained by the vet and hamsters are given antibiotic treatment afterwards to avoid any infection there. You should show your hamster to a vet soon. Cancer needs biopsy tests to get diagnosed.
I know this is old but someone else may see it. It sounds like it could be his hip spots since there are 2 on his back. They could be infected. Look up more info on hip spots and see if that is what he is scratching. While males have these, they can get infected at times.
My hamster has as big gash on his side