Work friends can work out
I have a few really good friends that I met through work.
Two were my bosses. One of my best friends was my student when I taught engineering.
For me the trick was having the same mentality, work is work. When at work, it's completely about doing the job to the best of your ability, leave the politics, socializing and ego's elsewhere. If they can do that then I'm open to friendships outside of work but am wary. Oh, I have to be able to have fun at work and be able to not have that fun interfere with the job. They have to be the same.
I will say I have never found friends where the work relationship was roughly equal. IOW, if there is a larger disparity between positions it's easier for that not to get in the way at work. It is clear who is the boss and who isn't. Likewise, the bosses I have befriended left me to my work and didn't interfere. So if I said this is what needs to be done, it got done because that was the area I was in control regardless of their position over me. If I never got that kind of relationship going, I got frustrated and quit.
Oh, socially, we were all equal. End of story. None of this power play shit like in the movies.
That's how its worked out for me anyway and I'm in friends with my workplace colleagues for about half my life now, decades.
Thanks for all the fish.