They tell you they’re calling from a prison because otherwise they could just call the right number. The trick is making people think that the person can’t make another call so they need you to do them a favor.
This exact thing happened to my dad. The caller ID said Utah Prison and it was some lady asking him to call her boyfriend for her. At first she said it was a wrong number and he did help her and called her boyfriend, but she kept calling back to have him do it and he just stopped answering. Luckily it didn’t cost him anything. I’ll have to tell him about this.