Take your dog to the veterinarian immediately. A vet can diagnose the cause of the rash and worms and prescribe appropriate treatment. Do not attempt home treatment, as this could worsen the condition.
Until you reach the clinic, keep your dog's skin clean and dry, apply a cold compress to reduce swelling and itching, prevent licking or scratching, provide fresh water, and feed a bland diet of boiled chicken and rice. Avoid giving any medication or supplements without first consulting your vet.