Yes, doctors can use X-ray for treatment of cancer. But, it is a part of radiation therapy, where X-ray and other high-energy radiation are used to destroy cancerous cells by damaging their DNA. This is different from routinely used X-rays for diagnosis of fractures/dislocations.