Norway would have a lot more trouble saying "ja" to socialism if it didn't have so much oil. That's what makes the whole thing seem like such a good deal - you're getting more than you're paying in.
In all of the Scandinavian countries the welfare state really didn't start until around the 1960s-1970s.
The government programs have only been possible because of the successful private economy to pay for it, just like in the US.
Although Denmark doesn't have the massive oil wealth that Norway does, there is still some and enough that Denmark is a net oil exporter. And the Danish state gets billions of kroner from oil each year.
Much like the case is with Sweden, Denmark, Finland...who run the same system without oil, and gets similar results.