Yes internal medicine doctors can sometimes treat chronic pain.
However as an internists the internists has limited experience and knowledge when it comes to treating chronic or any pain.
Usually the internal medicine doctor will refer you to a physician when you have chronic pain that needs treatment.
The internal medicine doctor can also prescribe some pain management medication to help with the treatment of your chronic pain.
Although whenever I saw an internal medicine doctor they did help with my pain somewhat but referred me over to a physician to further treatment of my chronic pain.