Rick realizes they are in a simulation and uses a "rap concert" to overload the system's RAM. They seemingly escape, but the "real world" they return to is actually a second simulation. Rick realizes this when his safe's passcode fails.
Their extreme discomfort with nudity is a likely nod to David Cross's "Never-Nude" character from Arrested Development .
The "Morty" accompanying Rick throughout the episode was a simulation the entire time. Rick ultimately games the scammers by giving them a fake recipe (Cesium and Plutonic Quartz in water), which causes their ship to explode. Deep Dive: Easter Eggs & Trivia