Program helps rehab dogs, inmates