Basically just what the title asks. It seems like this type of thing only happened in the movies, but I'm curious to know if the way it's depicted is the way it happened in real life?
For what it's worth, the "true story" book it was based on ([Wiseguy](https://en.wikipedia.org/wiki/Wiseguy_(book)) by Nicholas Pileggi) is about the life real-life gangster Henry Hill. It's really worth a read.
It's certainly fair to question how much of what Hill says is true, but his claim that the mafia really did turn prisons into their personal social club seems legit. Here's a 1997 New York Times article about the 10 month sting operation dubbed 'Operation Badfellas'. 11 federal corrections officers were arrested, including a union leader.
Some of the seized contraband included ''20 pounds of pasta, a gallon of olive oil and a box of garlic" and ''approximately 25 pounds of Italian food including meatballs, sausage, mozzarella and manicotti.'' Also the usual fare you'd expect, such as drugs.
Guards would look the other way while mafia prisoners used makeshift hotplates (and even a microwave) to prepare elaborate meals, and help them set up meetings so they could still run their criminal enterprises.
Things went even dangerously further. Guards would let inmates use corrections facility computers, which let them find the names of everyone involved in some investigations. Including confidential informants.
It would appear that Goodfellas, if anything, understated what guards would let the wiseguys do while serving their time.
Edit: If you haven't seen the film, here is a clip from that scene: https://youtu.be/yztx8qfoNu0