Can you build a house from styrofoam?
Only Styrofoam? No. You can't. Not without some considerable engineering of the material, and even then with a great number of limitations. I can imagine a couple of possible, highly theoretical, methods of doing so, but none of them are currently available or even practical, so I'm not going to entertain the ideas here.
Expanded foam products simply don't have the structural capacity to resist the forces involved in built structures. Buildings must resist vertical forces of gravity of the structure itself, the contents, snow loads, and people moving around, lateral forces and uplift forces from winds, and seismic forces from earth settling and earthquakes. Foams don't usually have the compressive or tensile strengths necessary to resist any of those.
What foams can do efficiently is trap air and resist thermal conduction. They are excellent insulators. So, by combining a foam product with a material that can resist structural forces, you can create hybrid construction materials with high efficiencies. Most panelized construction products use this approach. Structural Insulated Panels (SIPs) typically combine outer layers of plywood with an inner core of rigid foam to form a sandwich panel which, when combined with wood framing members, form an energy efficient construction system.
Sure. A dog house for sure. Maybe abit bigger like a shed if you get everything just right. But there isn't enough structural strength to support floors or trusses without real meat to carry loads and shear strengths.
There are sip (structural insulation panel) products that are available to assemble walls which have foam insulation within them, and several manufacturers offer pour-concrete in place block structures to create insulated concrete foundations. These are great. But they integrate rigid and supporting concrete bits that will withstand liveloads and shear strengths needed for real builds.