Lots of things.
Ulcers on legs can be due to infection, poor blood supply, or even skin cancer
Ulcers on buttocks are often due to pressure from prolonged sitting or bedrest. Ulcers in the mouth have many possible causes. Chronic infections can cause nonhealing ulcers just about anywhere on the body.