This is a complicated question because "pacifism" has at least two distinct meanings. It may mean "opposition to all violence," or it may mean "opposition to all war (i.e., organised violent conflict between governments)." Some anarchists are pacifists in the first sense; a very large majority of anarchists are pacifists in the weaker, second sense.
The primary anarchistic inspiration for pacifism in the first sense is probably Leo Tolstoy. Drawing his themes from the Gospels, Tolstoy argued that violence is always wrong, including defensive violence. This naturally leads Tolstoy to bitterly denounce warfare as well, but what is distinctive here is opposition to violence as such, whether offensive or defensive. Moreover, the stricture against defensive violence would appear to rule out not only retribution against criminals, but self-defence against an imminent attack.
This Tolstoyan theme appears most strongly in the writings of Christian anarchists and pacifist anarchists, but it pops up quite frequently within the broader left-anarchist tradition. For example, Kropotkin looked upon criminals with pity rather than contempt, and argued that love and forgiveness rather than punishment was the only moral reaction to criminal behaviour. With the self-described Christian and pacifist anarchists, the Tolstoyan position is a firm conviction; within the broader left-anarchist tradition, it would be better described as a tendency or general attitude.
Some left-anarchists and virtually all anarcho-capitalists would strongly disagree with Tolstoy's absolute opposition to violence. (The only anarcho-capitalist to ever indicate agreement with the Tolstoyan position was probably Robert LeFevre.) Left-anarchist critics include the advocates of revolutionary terrorism or "propaganda by the deed", as well as more moderate anti-Tolstoyans who merely uphold the right to use violence for self-defence. Of course, their definition of "self-defence" might very well include using violence to hinder immoral state actions or the functioning of the capitalist system.
The anarcho-capitalist critique of Tolstoyan pacifism is somewhat different. The anarcho-capitalist generally distinguishes between initiatory force against person or property (which he views as wrong), and retaliatory force (which he views as acceptable and possibly meritorious). The anarcho-capitalist condemns the state precisely because it institutionalises the initiation of force within society. Criminals do the same, differing only in their lack of perceived legitimacy. In principle, both "private" criminals and the "public" criminals who run the government may be both resisted and punished. While it may be imprudent or counter-productive to openly resist state authority (just as it might be foolish to resist a gang of well-armed mobsters), there is a right to do so.
Almost all anarchists, in contrast, would agree in their condemnation of warfare, i.e., violent conflict between governments. Left-anarchists and anarcho-capitalists both look upon wars as grotesque struggles between ruling elites who treat the lives of "their own" people as expendable and the lives of the "other side's" people as worthless. It is here that anarchism's strong distinction between society and the state becomes clearest: Whereas most people see war as a struggle between societies, anarchists think that war is actually a battle between governments which greatly harms even the society whose government is victorious. What is most pernicious about nationalist ideology is that is makes the members of society identify their interests with those of their government, when in fact their interests are not merely different but in conflict. In short, anarchists of both sorts would readily accede to Randolph Bourne's remark that "War is the health of the state."
Left-anarchists' opposition to war is quite similar to the general condemnation of war expressed by more mainstream international socialists. On this view, war is created by capitalism, in particular the struggle for access to markets in the Third World. "Workingmen have no country" and should refuse to support these intra-capitalist struggles; why should they pay the dire cost of war when victory will merely leave them more oppressed and exploited than before? Moreover, while Western democracies often advocate war in the name of justice and humanitarianism, the aim and/or end result is to defend traditional authoritarianism and destroy the lives of millions of innocent people. Within the Western democracies, the left-anarchist's hatred for war is often intensified by some sense of sympathy for indigenous revolutionary movements. While these movements are often state-socialist in intent, the left-anarchist often believes that these movements are less bad than the traditional authoritarianism against which they struggle. Moreover, the West's policy of propping up local dictators leads relatively non-authoritarian socialist movements to increasing degrees of totalitarianism. Noam Chomsky is almost certainly the most influential representative of the left-anarchist approach to foreign policy: He sees a consistent pattern of the United States proclaiming devotion to human rights while supporting dictatorships by any means necessary.
The anarcho-capitalist critique of war is similar in many ways to e.g. Chomsky's analysis, but has a different lineage and emphasis. As can be seen particularly in Murray Rothbard's writings, the anarcho-capitalist view of war draws heavily upon both the anti-war classical liberals of the 18th and 19th centuries, and the long-standing American isolationist tradition. Early classical liberal theorists such as Adam Smith,Richard Cobden, and John Bright (and later Norman Angell) argued that warfare was caused by mercantilism, by the prevailing alliance between governments and their favoured business elites. The solution, in their view, was to end the incestuous connection between business and government. The American isolationists were probably influenced by this broader classical liberal tradition, but placed more emphasis on the idea that foreign wars were at best a silly distraction, and at worst a rationalisation for tyranny. Both views argued that "balance of power" politics lead inevitably to endless warfare and unrestrained military spending.
Building upon these two interrelated traditions, anarcho-capitalists have built a multi-layered attack upon warfare. Firstly, modern war particularly deserves moral condemnation (according to libertarian rights theory) for the widespread murderous attacks upon innocent civilians — whether by bomb or starvation blockade. Secondly, the wars waged by the Western democracies in the twentieth-century had disastrous, unforeseen consequences: World War I paved the way for Communist, fascist, and Nazi totalitarianism; and World War II, by creating power vacuums in Europe and Asia, turned over a billion human beings to Stalinist despotism. The anarcho-capitalist sees these results as predictable rather than merely accidental: Just as rulers' hubris leads them to try to improve the free-market economy, only to find that in their ignorance they have wrecked terrible harm, so too does the "fatal conceit" of the national security advisor lead Western democracies to spend billions of dollars and millions of lives before he finds that he has inadvertently paved the way for totalitarianism. The anarcho-capitalist's third point against war is that its only sure result is to aid the domestic expansion of state power; and predictably, when wars end, the state's power never contracts to its original limits.