it is not foolproof and also depends on which mode you are flying in at the time
no matter how many sensors your drone has when it comes to trees the they are not good bedfellows
Mavic pro at full speed head on vs. a dense evergreen: sensors will start to stop it but I think not in time to avoid collision.
Mavic pro at full speed tripod mode head on vs. a dense evergreen: sensors will stop it and avoid collision
Mavic pro vs. deciduous tree with sparse branches/leaves at any speed: Likely that it will fly into the tree.
With that said, I agree with old man and try my best to avoid trees altogether