I heard a Dungeons & Dragons horror story recently, and not the “mind flayers and zombies” kind. To summarize, a game was brought to a halt after a paladin killed a fellow player character to punish him for a murder. The second player character, I imagine, probably had the same excuse for his crime as the paladin for his - “I was only doing what my character would have done!”
I’ve heard this line more than once, and there’s a simple rule to cover this situation: alignment is a roleplaying tool, not a straightjacket. Be prepared to compromise your character in small ways in order to avoid impeding the flow of the game. You might find it unreasonable that your elf-hating dwarf character would accept a mission from an elven wizard, but if it gets in the way of the game at hand then you’re going to have to ask yourself: which is more important, my character, or the game as a whole?
Alignment, like any character trait, is something you decide, not something that makes your decisions for you. Better to find a reason why your lawful good character would put up with a crime than to bring a game to a dead end by killing the perpetrator, or worse, attacking a fellow player character. Ultimately, you make the decisions, not your character.