Moles are a very common condition. Most moles are benign and require no evaluation or treatment. However, given the abnormality of the mole you describe, I would strongly recommend seeing your primary doctor
or a dematologist.
As for your question, yes, moles can become infected. Just like any portion of your skin, bacteria, viral or fungal infections are possible. Bacterial infections of the skin, or cellulitis, are the most common and often caused by a break in the skin. Therefore scratching is a possible source for a cellulitis. Bacteria normally live on the skin so any break in the skin can allow the bacteria in. Red, warm or tender skin is consistent with an infection. This often requires antibiotics to treat so seeing your doctor is advisable.
Another concern is if this could represent a change in the mole. The change may not be infection but a warning sign for cancer. Most moles are benign and cause no problems. However, moles can also represent skin cancer. Melanoma is a common type of skin cancer often confused with a mole. Change in mole color, ulceration or growth maybe consistent with a cancer and therefore. Other types of cancer, like a squamous cell, can often look like infections. A dermatologist
can evaluate this lesion and potentially remove and /or biopsy
the lesion for further diagnosis.
I recommend you see your doctor.