Logicians distinguish two kinds of bad arguments, unsound and invalid, see IEP's Validity and Soundness. A fallacy is a flaw in logic that makes an argument invalid. Unsound arguments, on the other hand, may well be logically valid, but argue from false premises.
The problem pointed out in the OP, that the world referred to by the arguers is unrealistic, means that the premise is false in our world. Given that, however, B's point is well-taken, i.e. plausibly valid, it is similar to the logic of "in the land of the blind the one-eyed man is king". A, on the other hand, has a problem with his logic on top of the unsoundness. Defending yourself does not amount to killing people at random even if others are killing people at random. It would at most amount to killing people who are a threat, and even that is not given, since self-defense does not necessarily require the killing.
There is also another problem with the A's reasoning. "There is nothing wrong with killing people at random" is a value judgement, not a description of fact. Even in the world where "everybody" is killing people at random that alone does not make it right, does not mean that they ought to be doing it. After Hume many philosophers consider inferences from is to ought statements to be generally invalid, it is known as the is-ought guillotine or the naturalistic fallacy.
This last point touches on a connection between logic and ethics. "If everybody did it" hypotheticals are important in what is called meta-ethics, the study of ethical systems. They express what is called universalizability of ethical norms, and many ethicists consider it an important requirement that a reasonable system of norms must meet. Perhaps, its most famous expression is Kant's categorical imperative:
"Act only according to that maxim whereby you can at the same time will that it should become a universal law."
In other words, any norm of ethical behavior must be such that it would be rationally acceptable if everybody acted according to it. A's "norm" of killing people at random apparently fails to meet this requirement.