Like anything in dreams, when it comes to passing through solid objects, expectation is king. If you believe that the object is hard, you will not be able to put parts of your body through it.
One way to pass through a wall is to believe that it is made out of gas, liquid, or some other soft material. Another way is to believe that your own body is ghostlike and ethereal.
If everything else fails, try to hurl yourself through the wall at great speed (see also flying). This should over time build up the needed confidence to be able to penetrate walls at normal speeds.
Also,you can try "merging through" with wall surface slowly by pushing against it.