An interesting question. The technical answer is that "No, they cannot co-exist." But the practical answer is that, though on different spheres of reality, spiritual versus rational, they do co-exist.
The definition of mercy is forgiveness for wrong doing that is born of compassion, kindness, forbearance and benevolence; it is the optional power of a judge to forgive someone for wrong doing.
The definition of justice is the fulfillment of the process of the law and the administering of punishment required by the law for wrong doing.
The definitions have nothing in common: they are separate concepts altogether. Justice is to administer the law, whether moral or legal. Mercy is spiritual virtues of compassion, kindness and benevolence. They are on different spheres, just as, for example, singing and economic gain are on completely different spheres of reality. It is the difference in their spheres that ultimately makes it possible for one to influence the other, just as beautiful music in song can influence economic gain.
Mercy can lift you from the demands of justice. A judge or a parent or a friend or anyone may choose to set aside justice and embrace and extend mercy instead of justice. In other words, because mercy and justice are such different things from each other, a person may choose to step out of one sphere into the other sphere and in this way, from a different sphere, replace justice with mercy.
They can co-exist and in a perfect world, they always would. One definition of justice is "the principle of moral rightness; equity." Justice (equity) can be served within the bounds of compassion. A person can be held accountable for a crime or misdeed without being tortured or treated inhumanely. The Constitution, of course, even forbids "cruel and unusual punishment." Being merciful does not require ignoring crimes or transgressions. It means taking into account the humanity of one who has committed a crime or transgression while seeking equity.
Yes, I believe that justice and mercy are not mutually exclusive. While the voice of justice is one that seeks resolution, I don't believe it speaks in terms that are non- merciful. Punishment within the justice system does not have to be merciless. Certainly, some applications of justice deny mercy, but the concept, in its own right, does not seem mutually exclusive with mercy or compassion.
Mercy is an essential part of justice. It is important that the concept of "tit for tat" or "an eye for eye and a tooth for tooth" is not justice. That is only revenge.
The purpose of justice is not to seek revenge, but to secure well being of the society as a whole. There are times when this can only be secured through punishment. But more often, mercy and the act of forgiving are more effective ways of securing well being for all. Mercy gives the offender an opportunity to reform and improve. At the same time it also gives mental peace and satisfaction to the person showing mercy.
In Merchant of Venice Shakespeare writes:
Quality of mercy is not strain'd,
It droppeth as the gentle rain from heaven,
Upon the place beneath. It is twice blest:
It blesseth him that gives and him that takes.