I can have lunch and water cooler chat friends at work, but rarely do they turn into invite over to bbq on the weekend friends. There's a big difference.
You can be friendly, but when something happens at work and one of you no longer works there...things get weird. Those weekend bbqs that you had with work friends no longer happen, or they keep going for a bit, but conversations are awkward since the still employed are no longer free to discuss or the no-longer employed harbors resentment that isn't exactly hidden. What kind of "friend" was that after all?
It all depends. Most of my coworkers are friendly, some are friends. We respect each other, etc, but it most cases any contacts end when someone leaves the company. The key marker is can I discuss any matters, including inappropriate, politically incorrect? In most cases not. But with true friend we can discuss anything without a fear of being reported. And we are still in contact many year after.
This and other kinds of social issues are why some cultures put a very clear line between professional and personal. God forbid if it concerns intimate matters, which are the worst.
You can be friendly, but when something happens at work and one of you no longer works there...things get weird. Those weekend bbqs that you had with work friends no longer happen, or they keep going for a bit, but conversations are awkward since the still employed are no longer free to discuss or the no-longer employed harbors resentment that isn't exactly hidden. What kind of "friend" was that after all?