There could be a number of reasons for this, ranging from a minor irritation to a more serious infection. A vet can properly diagnose the problem and recommend the best course of treatment.
Please do not try to self-treat your dog. Getting professional help from a veterinarian is the best way to ensure your dog's health and well-being.