It's an art, or rather a learned trick based on lots and lots of empirical knowledge gained from experience. You know your lens, you know your body, you know what framing problems can be solved with a lean or a roll, and which require a step forward, to either side, or more dangerously, back. A glance behind you assures you you can do it without stepping off a curb into traffic or warns you that you have to reconsider the entire shot. The interesting thing is that with practice you can do all of this without involving your conscious mind, which should be entirely concerned with the view through the viewfinder and your exposure and composition.
For what's worth, I never think about either millimeters/ focal length or meters(feet)/distance. It's just me in space, my subject in space, my camera and lens in space, the relative positions of all three, and the view through the viewfinder.