So why did he shoot with his left hand in A New Hope?
Luke is pretty consistently shown to be ambidextrous (having the ability to use both hands without favouring one) throughout the original trilogy film series.
It's not clear if this was an intentional directorial choice, a goof (reversed plates meant that Fett's antenna swapped sides repeatedly during the Skiff scene and Luke's lightsaber would repeatedly jump from his left to his right hip, for example) or whether Lucas simply didn't notice or care that his main actor (who's left-handed in real life) was using his hands interchangeably.
During the Detention Centre shootout, Luke is taking cover on the right-hand side of the corridor (from his perspective) and the alcove he's using for cover would make it harder to fire his blaster right-handed. He's trying to stay behind that little bit of bulkhead as much as he can to avoid the incoming Stormtrooper fire, so holding the blaster in his right hand would mean having to lean farther out to get a shot off and making himself more of a target.
In Cloud City, you can see that Luke's hiding behind a wall at a left-hand turn (his perspective), so naturally he wouldn't need to shift his sidearm to another hand since he'd still be in cover if he decided to lean out and shoot at Fett and the Imperials.
EDIT: Several comments have indicated that Mark Hamill is left-handed, while I've also seen that Luke may be intended to be ambidextrous with a preference for one hand or the other depending on the action. But in terms of in-universe actions, Luke's simply taking best advantage of his cover the same way that Han and Chewie are shoving themselves up against the wall in the Detention Centre. As a side note, you'll sometimes see Stormtroopers carrying their blaster rifles left-handed; this was because the Sterling submachine guns used for the blank-fire props have a VERY awkward horizontal magazine that sticks out of the left side of the gun and makes it difficult to hold in the typical "Stormtrooper Ready" position, even with a chopped-down 10-shot magazine.
Valorum's answer ably points out the ambiguity of Mark Hamill's ambidextrousness. This could be caused by:
- The director telling him to use his right hand in some scenes (for composition/framing) and not caring to in others - in cases where Mark using his left hand might either block or not make it clear whatever action he's performing
- The film being mirrored to make him look right handed
- Mark really being ambidextrous
As a left-handed person myself, who has some shooting experience with hand-guns and rifles, I can say with some certainty that left/right handedness doesn't always correlate to which hand you hold the weapon in. When I hold weapons, my right hand is the trigger-holding hand, and my left is the support hand. For racquet sports, I'm fully left-handed as there's no dependency on eye dominance.
I am left handed, but right eye dominant. There's various aspects of this eye dominance that come into play when shooting
Different types of dominance
Most adult men have one eye that directs their pointing, right-handers tending to have a dominant right eye and the bulk of southpaws a dominant left. When they point at a distant object with both eyes open, they will line up with one eye rather than the other. The dominant eye, the fingertip, and the selected mark, will all be points on a straight line. Shooting is easier and has more effect if you can shoot with both eyes open.
Binocular vision facilitates the estimation of distance, speed and angle and helps one to gain the full benefits of natural hand to eye co-ordination. If you doubt it, try catching a ball with one eye shut. But, do not believe those who say simplistically that everyone should shoot with two eyes. It’s not as simple as that.
Eye dominance terminology
Absolute dominance in the eye looking down the rib – keep both eyes open and focus locked on the bird, the bird and nothing but the bird.
Predominant dominance (one eye is predominantly but not fully dominant) in the eye looking down the rib – keep both eyes open with appropriate cast, or, squint an eye as the gun comes to the shoulder or otherwise block the vision to it.
True cross-dominance (eg right-handed but left eye dominant) – squint/close opposite eye, block vision to it, use a full crossover stock, or change shoulders.
Intermittent or occasional cross-dominance – probably caused by poor focus discipline or bad gun fit. Consider what rib picture you can see when the gun is mounted at 45 degrees with normal cheek pressure.
Central vision (neither eye dominant) – close eye opposite rib, block vision to it, consider acquiring a semi-crossover stock.
Indeterminate dominance – both eyes fighting for control, close eye opposite rib or block vision to it.
Stormtroopers obviously suffer from any one of the last three variants of eye-dominance.