Meaning: In the context of hair cuts specifically, you can use both without concerns as it is (usually) obvious that people get their hair done by others. (Unless it's very obvious someone did it themselves :))
However, in other situations (especially formal) I would be a little bit more attentive to which one of those I use:
Hey Sam, what about the mail I asked to be sent by this afternoon?
If Sam did it himself, he'd usually say:
I got it done
(If Sam doesn't have to use either of "got it/had it" he'd just say "I did it/I sent it" to avoid any potential confusion)
If Sam had someone do it for him, he'd usually say:
Don't worry, I had that one done / I had it done / I had it sent
I got someone to do it for me
(more casually: I got someone to do it)
"Got it done" usually means that the speaker carried the action himself. "Had it done" almost always means that someone else had done it on the speaker's behalf.
Formality: "I got my hair cut" is the more casual way to phrase it.