When you use to with an institution like a prison or a university, it indicates that you were there as one of the people that it's intended for- as an inmate of a prison, or a student of a university. If you worked there as a warder or professor, you would not use to.
in can be used in the same way about a prison, but not (in UK English) a university or school.
If you want to talk about visiting the physical premises of a type of institution, but not as a student or inmate, you would add an indefinite article, or specify the name of a particular institution:
I have never been in/into/inside/to a prison.
I have never been in/into/inside/to Broadmoor prison.
I have never been to a university
I have never been to Cambridge university
You would not use in/into/inside for a university because a university is generally made up of several independent buildings. A prison may have multiple buildings, but they are generally all enclosed by one wall or fence.