Unity's collision detection is discrete so if an object passes through another object within 1 simulation frame, the collision will not be detected. If the collision is already detected, however, forces should push the objects apart and prevent a pass-through.
You can adjust the physics settings to make Unity's physics respond more accurately to collisions, and thus make pass-throughs less common. There are several settings you might consider changing:
Fixed Timestep: This field in the Time Manager controls the rate at which the simulation is run. A smaller value means there is less time between every simulation frame, thus less chance a collision will not be detected.
Collider size: The bigger the collider, the more an object will have to move to pass through and dodge the collision detection.
Adaptive Force: Found in the physics manager, setting this value to true will make force transfer more realistic so instead of just hitting a brick wall and overlapping, the force will be transferred to the brick wall.
Solver Iteration Count: This is basically how many times the collision resolution algorithm is run per simulation frame. The more times, the more accurate - the less passthroughs.
Min Penetration For Penalty: If 2 objects overlap more than this magnitude, collision forces will be applied. The lower this value, the less chance there will be a pass-through.
Continuous collision detection: I don't recommend this for, well, anything because it takes a huge toll on performance but this will guarantee all collisions will be detected. Usually if something needs continuous collision detection (like a bullet), it can be handled with other means like raycasting.
Note that all of these settings have the potential to decrease performance so you should thoroughly tailor them to your game. You can find more information on these settings in Unity's documentation: http://docs.unity3d.com/Manual/comp-ManagerGroup.html.