Let us assume normal physics.
The trappings of the Thor comic relies on the old adage about sufficiently advanced technology being like magic.
The only thing in normal physics we know of that might cause this kind of spacial locking is quantum levitation .
It is not simply being heavy, because his hammer has been used to pin people in place without crushing them.
This suggests that, like in the above video, Thor's hammer can 'turn on' superconductivity, and perhaps is so advanced that the geometry of the locking is stronger and effective even in a smaller magnetic field.
If this is the case, you'd have to go far into space before the effect would stop working.
And it would always be relative to the nearest strongly-magnetic source.
It also means that you might be able to overcome the locking with local magnets, if this is in fact the mechanics behind the hammer's ability to stay motionless when without Thor's grasp.
It also can explain the ability to toss the hammer.
See the video and use your imagination.
scifi.stackexchange.com/users/51/DampeS8N
After reading some of the answers here, and further Google (re)searching, I came to the following:
There are two parts to wielding Mjolnir.
Lifting Mjolnir Wielding Mjolnir
(possessing Thor's power) Before wielding Mjolnir, it needs to be lifted.
As portrayed in much of the modern comics and movies, unless you are worthy, the hammer won't budge from where it is (Excluding the axe/hammer version of Mjolnir ).
But in most cases, there is gravity in place.
When there is zero gravity, it can be moved.
Two examples of this: Ironman and Red Hulk are two characters that encountered Mjolnir in outer space, and were able to move, grasp, and even use it on Thor.
Ironman encounters Mjolnir in space, grabs it, and moves it.
Upon entering Earth's atmosphere, gravity pulls Mjolnir towards the ground, and Ironman can no longer move it.
Red Hulk is able to swing Mjolnir in space.
Although there may have been a loophole also that Rulk actually took possession of the hammer from Thor.
However, being able to lift or move Mjolnir doesn't equate to being worthy nor is the same as wielding it.
The inscription on the hammer states: Whosoever holds this hammer, if he be worthy, shall possess the power of Thor .
It doesn't say that it cannot be lifted.
It states that it be held AND if is worthy, shall possess the power of Thor.
So we can interpret Odin's enchantment to generally apply to those that lift it and are worthy.
For the cases when it can't be lifted, it is a side effect when gravity is present.
TL;DR
So, in short, yes it can be moved in outer space, but not wielded.
The worthy can lift and wield it.
The unworthy cannot lift it when gravity is present, but they can move it absent a gravitational pull.
They also cannot wield it nor possess the power of Thor.
Sources: Mjolnir wiki entry
How did the Red Hulk lift
Thor’s hammer?
Revamped Thor Respect Thread: Section on Essential Mjolnir [dead link]
scifi.stackexchange.com/users/1042/spong
I think DampeS8N's answer provides a more thorough explanation, but even assuming that the hammer can't be lifted on Earth by the unworthy simply because it's too "heavy", that somehow the mass of the hammer is felt by anyone who isn't meant to wield it, then the same would apply in space.
In space, you may not feel the force of gravity from a large planet, but the laws of mass and inertia still apply.
So if someone who isn't worthy of wielding it tried to pick up or swing the hammer, they would just swing themselves around the hammer instead of moving the hammer itself.
scifi.stackexchange.com/users/3393/Lèse majesté
The will of Odin overwrites the physics, if the all father has decreed only the worthy can wield it, then, outer space or not, the hammer is unwieldable ( not immovable ) by Odin's will, there is no room for puny human physics loopholes to the contrary.
According to Odin's enchantment only the worthy can wield it, just being able to lift it
it doesn't mean they can
wield it, the same way a caveman can use a Sniper gun to club somebody in the head, the unworthy are unable to use the true power of the Mjolnir.
To them it is nothing more than a simple hammer.
scifi.stackexchange.com/users/780/jimjim
No, only by Beta Ray Bill , but he doesn't need to, because Odin made him his own.
scifi.stackexchange.com/users/6064/Julian
Thor's hammer,  Mjolnir , according to Odin's enchantment, can only be wielded by those deemed worthy.   Does this only apply when the hammer is subject to gravitational pull? What happens when it's in outer space away from any pull? Would those unworthy be able to wield it?
Can Thor's hammer be wielded by anyone in outer space?
scifi.stackexchange.com
<marvel><thor-marvel><mjolnir>
scifi.stackexchange.com/questions/7139
scifi.stackexchange.com/users/1042/spong
When there is zero gravity, it can be moved.  Ironman encounters Mjolnir in space, grabs it, and moves it, and Red Hulk is able to swing Mjolnir in space. The unworthy  cannot  lift it when gravity is present, but they can move it if there is no  gravitational pull. However, it is said that the will of Odin overwrites the physics - if the all father has decreed that only the worthy can wield it, then, outer space or not, the hammer is unwieldable ( not immovable ), and there is no room for feeble human physics loopholes to claim the contrary.    Though the hammer can be lifted in zero gravity it cannot be wielded meaning that the powers of Thor will not be bestowed upon you.
There are instances of individuals who are unworthy being able to lift the hammer is zero gravity. The hammer can be lifted in zero gravity, but not wielded i.e. they cannot use Thor's powers.