Yes, and it is more structured than most people on the outside realize.
The process starts at intake. When an inmate first arrives at a facility, they go through a comprehensive screening that covers medical history, mental health, and substance abuse. That assessment is not just paperwork. It informs the classification and placement decisions that follow. An inmate identified as having significant substance abuse or mental health needs can be designated to a facility that has the specific programs to address those needs, rather than simply being assigned based on security level alone.
What is available varies by facility and system. Federal prisons offer RDAP, the Residential Drug Abuse Program, which is one of the most intensive and well-regarded substance abuse treatment programs in the correctional system. Successful completion can reduce a federal sentence by up to twelve months and comes with earlier transfer to a halfway house. State systems vary considerably but most have some form of drug treatment programming, mental health services, and in many cases vocational and educational programs that address the underlying factors contributing to the criminal behavior.
Medical rehabilitation for physical health conditions is also available, though the quality and speed of care is generally below what people receive on the outside. Facilities are required to provide medically necessary treatment, and chronic conditions, injuries, and mental health issues are supposed to be managed throughout the sentence.
The key for your person is to be honest and thorough during intake screening. The system can only designate someone to appropriate programming if the need is documented from the beginning. Downplaying substance abuse history during intake, which some people do out of pride or concern about stigma, can result in being placed somewhere without the programming that might actually make a difference.