Dream codes — officially known as Dream Addresses — are 12-digit numbers with the prefix 'DA'. They permit you to visit other players' islands in your dreams and explore without the need for that player to 'host' you in any way, or worry that you'll damage or steal anything. Everything you see here is just a dream, remember!
To visit another island in your dreams you'll need a connection to the internet, a Nintendo Switch Online subscription, and you'll also need to go to sleep (obviously). To do so, find any bed and lie down (upon downloading the update, you'll receive Luna's Bed in the mail).
Simply choose "Yeah, I want to sleep..." and follow the instructions from ethereal aide Luna. Choose "I want to dream" and you'll connect to the internet to visit another island - you just have to input a Dream Address code. Alternatively, you can upload your island for others to visit by choosing "I'd like to share a dream".
Once you have input the Dream Address, you'll awaken in the main plaza of your dreamy destination. On the plaza you'll find a Custom Design portal where you can immediately download and take home and custom designs used by your dream island's architect, and you're free to wander and explore. You may even find the architect of your dream island hanging out somewhere!
Should you find something unsavoury and the dream turns into a nightmare, you can report any nastiness by hitting the '-' button. To leave the dream, lie down on the bed again and choose to wake up. Easy!
It should be noted, though, that you can't take tools or anything else with you into the dream, and you can't leave with items you pick up while slumbering either. It's just a dream, remember!