This is an extremely tricky and delicate situation. As a DM, I generally do not allow social skills (Diplomacy, Intimidate, etc) to be used on other PCs, and while I've never had the issue come up, I don't think I would allow mind-control magic to be used either. The reason?
People play RPGs to participate in a group story with a character under their own control.
By taking away that player's autonomy, even just at certain times and even just for specific and generally noble reasons, you're taking away that player's fun.
I played under an extremely controlling GM once, and it was a miserable experience. It was so long ago I don't remember the specifics, but one particular incident that stands out in my memory is when my character did something that all the other players considered reasonable, but which didn't follow the path the GM wanted us to follow. The GM had an NPC knock me out (no saving throw, no defenses, just boom! unconscious), throw me in a bag, and literally drag me along in the plot. He argued that it was the right thing to do because it forwarded the plot, but I stopped playing shortly after, because it's not fun when someone else controls my character. After all, why am I even there, then?
One way you might have handled your situation without taking away the player's autonomy would be to talk to her, out of game, about how her character and her choices were interfering with the group and the game. Ask her for ways that her character could be more closely integrated into the group's goals, and discuss what might happen if she insists on playing in a counterproductive manner.
As an example, in one of my more recent games, I played a chaotic barbarian in a generally good-aligned group, not unlike your situation in many ways. My character had been magically altered to have a "trigger" that would send her into an unstoppable rage when set off. At first it was an interesting roleplay opportunity, but later an unfortunate series of events caused my character to kill an important NPC while in one of those rages, which lost our party major face with key political figures. After that session, the GM suggested to me that my character might not be a good fit for the party, and asked me to consider rolling up a new one. I could see the problems and I was aware that the party was upset about the NPC's death, so I agreed.
In my situation, the GM was on the ball, both about handling things out of game, and about finding a way for my character to exit the party gracefully. Your GM could have dealt with the matter differently, by talking to the player out of character, or by telling the group to find a way to resolve it in-character (and making it possible by finding a way around the "All of you" decree).
So in short, yes, it was wrong to take away another player's autonomy and choices, no matter the reason. If it must be done, then discuss it with the player first, and make sure you have their full consent before doing it.
A creature that's been the victim of a dominate spell usually remembers the events that occurred unless steps are taken to make the creature forget
In Pathfinder, if the creature couldn't otherwise choose to forget, the dominated creature can't be ordered to forget.1
The spell dominate person et al. says that
You can control the actions of any humanoid creature through a telepathic link that you establish with the subject's mind.
Emphasis mine. Among typical creatures, there's no action for forgetting. So while a dominator can totally command the dominated creature to forget something, doing so won't have any more effect than commanding the creature to experience love for the dominator, suffer pain, catch a disease, remember its own birth, see something ethereal, or poop out a squirrel. Having the dominated creature perform such (presumably) impossible actions are beyond the scope of dominate spells. (If the creature does have special abilities that enable it take one or more of these actions, however, all bets are off and the dominator can command away.)
So the creature, in fact, remembers the entire dominated experience, and, actually, the creature can't just forget it. Further, as memory is so closely intertwined with the fundamentals of personality, dominators may know that even commanding a creature to perform such an act is "against its nature [and the creature] receives a new saving throw with a +2 bonus," but that's probably a bit extreme.
A very careful dominator could make it difficult for the creature to understand the actions the creature undertook while under the influence of a domainate spell, such as commanding the creature to close its eyes or cover its ears, but those are actions which can be performed.
So while under the influence of the dominate spell, the creature's memory remains as functional as his mental abilities, experiences (personal and perhaps game-mechanical), and abilities allow. Properly speaking, recall isn't governed by any particular ability score (although Intelligence appears the most likely candidate, arguments can be made for Wisdom and even Charisma—My sense of self is so vast that anything I experience matters deeply to me or whatever), so determining the extent of typical memory is up to the GM. However, unless steps are taken to make the dominated creature's memory of its dominated experience fuzzy (e.g. the enchanter commands, "I order you to consume booze until your memories of my commanding you are a blur," and then lets the spell run out), a creature should be able to recount anything it's done as the enchanter's puppet, and such memories should be as accurate as anything else its done in its life, limited only by the GM's judgment of the creature's ability scores, special abilities, and experiences.
This, by the way, may help explain why vampires are frequently depicted as throwing the best parties.
1 Dragonmarked for Pathfinder's antecedent Dungeons and Dragons 3.5 on Mnemonic Training says
Just as Autohypnosis can be used to memorize text or phrases, it can be used to forget them. Each successful DC 15 Autohypnosis check allows a character to expunge a message he has read or heard (up to 800 words) from his memory. Multiple checks allow a character to forget longer conversations or documents. [...] If you do not use the Expanded Psionics Handbook in your game, characters can accomplish this task using the Concentration skill but with +2 to all DCs. (75)
Whether such techniques can be used by anyone or only those of House Sivis in the Eberron campaign setting is the GM's call, as is whether such techniques can be used to forget events as well as conversations, phrases, messages, and text. The skill Autohypnosis is available from 3rd-party publishers in Pathfinder.
Best Answer
It's complicated.
To begin with, yes, you can cast it on yourself.
The target line is "one humanoid," with no further restrictions in the text of the spell. If you are a humanoid, legally, you can Dominate yourself.
What happens next is ambiguous.
The spell is ambiguous on several key points:
It is clear that the target entering the Dominated state and receiving its first order are part of the same action. But what happens first? Does the subject "become dominated" and then "receive its first order," or the other way around?
Can the target still think in ways that don't require an action? Or are they in a completely will-less state?
The argument for permitting it goes like this:
You cast Dominate Person on yourself, with a command something like "act the way you want to." You are now dominated, and single-mindedly performing the task of... Acting exactly like you're not dominated.
The key point in favor of this is that there is no complexity limit on commands:
Doing whatever you want is certainly within your abilities, therefore you profit.
It's a little cheesy, but the "be yourself" loophole isn't without precedent in genre fiction.
Argument for not permitting it (kill it with fire):
You cast dominate on yourself. You enter a dominated state, and wait for orders. Unfortunately, you no longer have the will to order yourself around, so you wait in a will-less state ("to the exclusion of all other activities except those necessary for day-to-day survival (such as sleeping, eating, and so forth).") for the duration of the spell.
Argument for not permitting it (except at a cost):
You cast dominate on yourself, and give yourself a command (but not "be yourself," because what does that even mean?). You then enter the will-less state of domination, and are unable to change the command once given.
Appendices
I. Wishful Legalism
And then, when the DM narrates some psychotic action you look him dead in the eye and say "I don't want to do that." At that point the DM is either violating the rules of the spell, or dictating what your character does/does not want. Either is bad.
Remember: Unlike with alcohol, you still have your full capability to predict the outcome of your actions, and use that to determine what you actually want.
But suppose your DM does say they'll permit this type of action, and then tries to weasel out of it by twisting your intent. In this case they might get you once or twice, but they have started a war they can't win. The command can be arbitrarily long, so you simply have to sit down, write something that you feel is ironclad, and keep iterating until the DM fails to screw you (you may want to do this in a secure location during downtime).
For example, the next step in the escalation would be something like this: "act as though you hadn't been dominated, except don't dominate yourself again (for the same purpose as the casting of this dominate)."
A smart DM will just flat out say "no" and pick one of the other interpretations (or declare it a house rule).
II. Saving Throws
Dominate Person allows its targets a number of saving throws. Do you need to worry about rolling too high, and accidentally breaking your own Dominate?
As it turns out, the answer is "no." You are always allowed to voluntarily forfeit a saving throw: