The best thing you can do is to take your hamster to a qualified exotics vet as soon as possible. Little critters can go downhill extremely fast, and home remedies are not safe or effective.
Any animal, large or small, with an injury can be taken to your local veterinarian for treatment. If you cannot afford this, you can try gently cleaning the toe regularly.