Sports such as boxing, UFC, MMA, etc involve heavy fighting. If such fights happen outside of the rink, the athletes would face criminal charges. So how are these events legal? Are there deals made with law authorities?
Disclaimer: I am not a lawyer. Talk to an actual lawyer trained in the jurisdiction you care about if this is important to you.
This is going to vary a bit between legal jurisdictions, but in England and Wales the fact that both parties have consented to the fight is important. There are limits to this (R vs Brown is the most notable case; the details are somewhat graphic so be warned before clicking that link), but an organised boxing match, properly sanctioned and with appropriate controls (e.g. a referee who will stop the fight if necessary, medical support available) is legal. A bare knuckle fight on the street will be treated differently and may be an offence even if both parties have consented.
As Philip sir said it is going to vary a bit between legal jurisdictions, but for Australia it is legal if they adhere to the Combat Sports Act 1987 and the Combat Sport Regulations 2013. Combat Sports Commission implement and oversee these act and regulation.
Ontario also has Rules and regulations for professional combative sports
This link also provide some extra information.
Summarizing: These event are legal in this cases because the law make them legal.