As smoke from the Camp Fire drifted over the San Francisco Bay Area this week, clouding the air around Amika Mota’s home in Oakland, she was reminded of her time in prison.

While serving a sentence for vehicular manslaughter, Ms. Mota, 41, began putting out car, structure and wildfires in Central California in 2012, one of roughly 4,000 inmate firefighters in the state. Through firefighting, the state tries to rehabilitate prisoners while providing a critical — and cost-effective — line of defense against a growing threat of natural disaster.

Ms. Mota found it to be a “transformative” experience that was a welcome and productive reprieve from prison’s widespread drugs, violence and abuse. She said she would have “loved” to make firefighting her career.

Yet she remembers one lesson that was drilled into her head: After you are released, do not expect to be a firefighter anymore — criminals will not get hired. So when she was released on parole several years ago, she did not apply.