There isn't a "correct" or even "optimum" working distance based on the magnification you get. It's going to be different for everyone, mostly influenced by your height.
I'm 6'2", and my working distance is 21".
A fellow in my class is around 5'4", and I'm not exactly sure what his working distance is, but it is FAR less than mine... possibly in the neighborhood of 15"?
Think about it this way... my torso is a lot longer than his, so when I'm looking at a patient in the chair, the distance from my eyes to the patient's mouth is around 21". His torso is much shorter, so he needs a shorter working distance. We can both have the exact same loupes and magnification and have totally different needs for working distance.
As far as what you said about "it sometimes looks focused when I try to look around the patient..."; if I'm interpreting this correctly, you're asking about depth of field? Like "NoPresident" said, things 2-3 inches further or closer from that "working distance" will be in focus. If you go beyond that, it's out of focus. So if you're working distance is set to 17", and the loupes have a "depth of field" of 3 inches, then objects from 14"-20" will be in focus (17", plus or minus 3"). Depth of field is not adjustable... it's just the nature of the beast with optics. The higher magnification you go, the smaller your depth of field will be. With 2.5x, the tip of the patients nose will be in focus, and their uvula in the back of their throat will be in focus, as will everything in between (just giving an example). With 6.0x, you might be looking at a canine and the second premolar could be out of focus.
Hope that helps.