Can a medium creature stand in the middle of 10′ hallway?

Playing on a grid, imagine a 10′ hallway. Can a medium creature stand between the grid squares, effectively leaving 2½’ on each side? Or does the creature have to "hug the wall" and leave full 5′ on one side?

Reference link to basic rules.

I’m asking this for two reasons:

  • mundane "block the corridor by standing in the middle" situation (would seem to block it for mediums, and force small creatures to squeeze, ie. use extra movement).
  • blocking the corridor from a frightened creature already standing next to you (if there’s a 5′ gap, they can circle you, but squeezing through 2½’ gap next to the very creature they fear, that seems a stretch…).