Sometimes they just don't like a hand in the cage, and it is very early days. Usually it's recommended to leave them alone for 2 or 3 days to settle in and then start taming, offering a treat through the bars at first and talking to them so they get used to your voice, and then moving on to a treat on the palm of your hand. Theoretically - but I have always found our hamsters hate you putting your hand in their cage. He is being territorial and running at it to see it off. The bite was probably to tell you to stop invading his space
Out of the cage he will be different. Suggest instead of putting your hand in the cage with the treat on, you get him to walk into a tube with a treat in, then lift the tube out with a hand over each end and put it down into something - have a box nearby or something. Or let him walk out of the tube into a hamster ball (take your hand off one end, put the tube end in the ball then pop the lid on when he walks in. Try not to worry about him biting you while in the tube - that would be quite difficult to achieve, but if you're worried, wear gloves so you don't drop him!
Once in the ball or box (if it's a box,sides need to be quite high) carry it up to the bathtub - dry with the plug in and put him down in there/let him out. Put the tube in there too so he has a toy/somewhere to hide and let him run around in there.
Bathtub taming is quite popular - they can't escape and can gradually get used to hands. Once he is hand tame he won't run at your hand in the cage (but he still may not like it and follow it round fussily!)
If you have an old toothbrush, at first in the bathtub you can use it to give him a gentle stroke on the back. If he jerks round and bites it, wait a bit and do it again,then leave it till another day - it can be time and patience. some will tame quite quickly. Our last syrian took two months! But once it happened it was sudden and instant and he was tame as anything.
Maybe twice a week take him to the bathtub. When you get to the point where he doesn't jerk and bite the toothbrush, move on to stroking him on the back with one finger - just one stroke then wait. If he accepts that move on to cupping a hand under him and lifting your hand 1cm or so and just letting him walk off a few times. Once he accepts that you could lift your hand a little bit higher and let him walk off then next time actually hold himand let him run between your hands like a tunnel. He should be tame then
It can take some timeand patience.
Until he is tame I would stick to offering treats through the bars, talking to him through the bars and also try the tissue trick (getsome sheets of toilet paper, stick them up your sleeve next to your skin for a couple of hours,then tear them into strips and add the pile in the cage. He will take some for his nest and get used to your scent.