I found that pacifism in D&D was a strain to play. It can be done but it is very frustrating to play. I don't think the streaming encounter traditions of the game lend themselves to playing this type of character.
It depends on how much of a jerk your DM is.
To begin with, the majority of pacifists are simply going to believe in not practicing violence toward other people. In the real world, this is a fairly straight forward category (with a few caveats we don't need to go into). In D&D, 'people' is something that has to be very rigorously defined and is going to depend on the campaign world and the particular character.
Are dragons 'people'? They are certainly intelligent, but does intelligence make them people? I would argue that while in the real world 'intelligence' is generally how many define personhood, or at least the salient fact about the group they consider persons, in D&D it's unlikely to be the most important fact in deciding whether something is a person. Undead or demons are highly unlikely to be considered persons. Rather, in D&D who or what created you probably defines your personhood in the eyes of most people.
And that means that in some campaigns you could have a 'don't kill people' or 'don't inflict violence on people' rule that almost never comes up in play because the giant rats, grey oozes, owlbears, giant spiders, ghouls, black dragons, ettercops, mephits, water wierds, mimics, flesh golems and so forth that you end up fighting don't fall under the category of persons as far as the character and indeed pretty much everyone else in the setting agrees. You only end up in edge cases like orcs or minotaurs that depend really on how the DM has conceived these creatures in his setting, which should probably should hash out with the DM before you sit down to play a 'pacifist'. Maybe your DM is like, "If it has 3 or more INT, then it is a person." In that case, you should probably just not play a pacifist, because the implications of something like a wraith or a demon being a person pretty much completely (IMO at least) preclude pacifism as a moral philosophy. In such a world, my suspicion is at no time ever would anyone ever advance the idea of the morality of pacifism. It's one thing to advance non-resistance to your fellow, peer-level, flawed beings. It's quite another thing to advance the idea of non-resistance to incarnate evil itself.
But if the DM limits 'person' to beings that are only often or usually of a particular morality, of sufficient intelligence, which are alive, which have free wills, and which are not inherently anti-life or anti-creation in their conception, then pacifism is at least a reasonable moral philosophy to explore. I would think part of making pacifism a playable concept would be having a DM that doesn't conceive of every NPC as an automaton that exists primarily to abrade hit points off of PCs, and who believes that no good deed should go unpunished because the world he believes in is one of no quarter, no mercy, and no limits. If you find yourself in a world were every single CE creature is willing to fight to the death at all times to uphold a cause, and has no end of vindictiveness toward PCs vastly superior in power to himself, then yeah - you can probably forget about useful exploration of pacifism as a concept.
And you are right, the hard part is always, "What do we do with the prisoners?" And the answer almost always has to be, "If we even used enough violence to subdue them in the first place, we let them go, with the promise they'll not interfere." And if the group can't deal with that, or the DM always has every mook trying to stab you in the back rather than saving its own pathetic skin, then again, you probably shouldn't try to play a pacifist.
One problem that I think pacifism is always going to run into in a D&D world is that evil tends to be very tangible all the time in a fantasy world. Fantasy worlds tend to be defined by ideas made flesh. So the whole idea behind pacifism that you aren't struggling against flesh, but against some underlying sinister spiritual force, stops making sense in a typical fantasy world. Even in the real world, there is a huge ethical debate regarding whether passively allowing evil to prosper and abuse to be inflicted on someone else can be regarded as good. Being willing to sacrifice yourself for the sake of not inflicting violence on someone and being kind even to your enemy is one thing. But passively standing by while someone abuses someone else tends to have consequences that don't appear to be actually loving or kind.
All that being said, I find that most nominally 'good' aligned characters are far more ruthless and bloodthirsty than I would think 'good' characters ought to be. I find they deliberately refrain from mercy when they can offer mercy, that they are treacherous when parlaying with others, and often as not murderous when they have the upper hand. I don't know whether this is because they've had former experiences with DMs that are jerks, that will allow no good deed to go unpunished even when it means utterly irrational behavior on the part of NPCs, or whether most players simply have no desire to play truly good characters. But I find 'murderhobo' to be far too applicable to characters that are often supposed to be 'good'. In terms of moral trajectory, almost every PC ends up in a downward moral spiral.
I don't quite get it, because I try hard not to be that DM. Every NPC that escapes them doesn't turn into a reoccurring villain. Self-centered NPCs generally don't want to poke the bear once they've escaped it once. Every authority figure tends to be at least somewhat competent and not motivated solely to screw PCs over. Yet I end up with throat slitting tellers of half-truths looking for legal loopholes for breaking their oaths, happily dispatching prisoners that 5 minutes before were complete strangers once the interrogation is over.