How does one know the difference between aversion and danger? How does a Buddhist know when to tolerate a situation, and when to exit a situation? For example, a lay Buddhist in an abusive relationship: is it correct to accept the abuse, or avoid it?

Disclaimer: I am not referring to my own relationship. I just chose this scenario as a hypothetical example.
Very interesting question. I'd say, as long as you can keep learning from it, it's OK to stay in an abusive relationship, may even be useful. But only if you know what you're getting out of it, what is it that it helps you practice.

May be patience, may be metta, may be egolessness etc. 

But once you have exhausted learning possibilities, I would say it's time to move on. In my mind this pertains to all types of difficult situations: abusive relationships, difficult job conditions etc.

If the pressure is so strong that it flips you into a victim mode all the times, and you completely forget that you are there to practice (as you would in a master mode) - that's probably a good indicator that the issue is more on the danger side than on the aversion side, I think it's a question of strength. There's no reason in subjecting oneself to what one just cannot handle, that stops being practice and becomes self-harm at that point.

So to summarize: 1) can you keep learning from this? 2) Are you not overwhelmed to the point of not being in control of your learning anymore?