Nobody is suggesting that you only make friendships at work or that you don't have any friends outside of work. That's a bad idea.
It is self-defeating to avoid becoming friendly with anyone you do work with, though.
And for what it's worth, my work friends were indeed very supportive when I quit past jobs. Leaving the job didn't end our friendships.