Bernard Williams wrote about this kind of issue. For example, in his contribution to Utilitarianism: For and Against (with JCC Smart, Cambridge University Press, 1973), "Utilitarianism and Moral Self-Indulgence", in Moral Luck (Cambridge University Press, 1981) and in Ethics and the Limits of Philosophy (Harvard University Press, 1985). There is a short account of some of his views in this article.
Part of what is at issue here is whether a person is morally responsible for the outcome of the moral decisions of other people, even if those decisions and outcomes are foreseeable. Suppose I sell weapons knowing that some of them may be used to do bad things, but I know that if I don't sell the weapons then someone else will, so the end result is no worse. In fact, the end result is better if I do it, because I donate 10% of my profits to charity, which is more than my competitors do. On some kinds of consequentialism, I am allowed to take into account the acts of other people when calculating the consequences of my actions, so my activity is justified. By contrast, on a version of absolutism, although I may calculate the foreseeable consequences of my actions, the chain of calculation (for me) ends at the point where another person's moral decision begins. I am responsible for my decision to sell weapons, but I am not responsible if someone else decides to do so, so I cannot justify my bad actions by appeal to what others may do.
As with many issues in ethics, things are a lot more complex than this and there are many variations on both positions.