I am not sure but it seems that 'obok' refers to 'the position' of being next to something whereas 'przy' rather refers to 'the distance'
Based off something I seem to remember from somewhere else, can't "obok" also mean "about"?
I always see on the doors of shops. "Wejście jest obok." Or something like this.