I'd echo everyone's cautions, but leaven them with some of my own experience.
In the olden days, I have used dry ice to hold temps low in regular coolers on long trips out West. You need to "cushion" it from direct contact with the container, as it's cold enough to cause cracking of some plastics. Wrapped in an old towel works fine, as it does sublimate (spelling above for the process is correct, even if your phone is not as smart as you are

), but doesn't melt.
This should work with a fridge, too, but YMMV.
I'd question whether a typical container that is NOT latched shut would contain the gaseous CO2 enough to cause the container to go boom. Never happened with my ice chests, but they had the typical friction closure. If your container does have a latch down system, then you should not latch it.
We'd travel with the cooler in the vehicle, but never slept with it. Flow through ventilation should keep the CO2 vented well enough when moving. I doubt the quantity typically used in an ice chest (2 pounds?) and subject to slow sublimation would build up enough to be a problem, even just sitting in a vehicle. And if using CO2, it's going to be warm enough the windows will have to be cracked.
This is the voice of my experience only. YMMV. Don't try this at home and all the usual warnings...
Now, lets go back to when I was younger and...not so smart. It's the early 70s, in Europe at a hilltop installation not to be named. After graduating high school, I went to work at the commissary to earn some college bucks before the AF sent dad back to the world with us.
I was the frozen food/dairy manager, responsible for receiving trucks coming from cold storage. Oftentimes, the trucks would be loaded overnight, then be set on the line prior to the run to the destination. The warehouse would top off loads that might sit awhile with 5 lb blocks of dry ice.
We'd have a great time filling the back of the store with fog by filling the produce sinks full of hot water and dropping a couple of blocks in. That was great around Halloween
One day I decided that some fog would be a great new feature for the party room, my humble abode in the basement of our housing building that was my bedroom. Originally built after the war so that officers had a place to put the hired help, the economy had shifted so no one had maids anymore. So they were ideal for older dependents needing a little peace and quiet -- to party on. There was a blacklight, various wild posters, strobe light, foiled ceiling with "meteors" and stalactites highlighted in day-glo...the list goes on and proper decorum forbids me mentioning names, etc.
Well, the fog was a hit. Later, time to hit the sack, so boxed it up and put it under the bed. Now, the rooms were only about 10x8, so pretty tight. Don't recall if the window was cracked or not. Did wake up the next morning with what seemed like the world's worst hangover...but I did wake up.
Then I thought a little and threw the rest of the dry ice out. Suppose I could have killed myself, but didn't. Just bad advice to do what I did when I was young and stupid.
On the other hand, people do travel with dry ice all the time -- by taking proper precautions.