Aeronautics Act, Section 3.1 Definitions: “Pilot-in-command” means, in relation to an aircraft, the pilot having responsibility and authority for the operation and safety of the aircraft during flight time.
Aeronautics Act, Section 8.5 No person shall be found to have contravened a provision of this Part or any regulation, notice, order, security measure or emergency direction made under this Part if the person exercised all due diligence to prevent the contravention.
CAR 602.31(3)(a)(b) The pilot-in-command of an aircraft may deviate from an air traffic control clearance or an air traffic control instruction to the extent necessary to carry out a collision avoidance manoeuvre, where the manoeuvre is carried out (a) in accordance with a resolution advisory generated by an Airborne Collision Avoidance System (ACAS) or a Traffic Alert and Collision Avoidance System (TCAS); or (b) in response to a warning from a Ground Proximity Warning System (GPWS) on board the aircraft.
CAR Standard 725.20 (v) Once a flight has commenced, the final decision on any changes to the Operational Flight Plan shall be taken by the pilot-in-command based on considerations of safety.
Basic Regulation 216/2008, Annex IV, 7c. The pilot in command must have the authority to give all commands and take any appropriate actions for the purpose of securing the operation and the safety of the aircraft and of persons and/or property carried therein.
Basic Regulation 216/2008, Annex IV, 7d. In an emergency situation, which endangers the operation or the safety of the aircraft and/or persons on board, the pilot in command must take any action he/she considers necessary in the interest of safety. When such action involves a violation of local regulations or procedures, the pilot in command must be responsible for notifying the appropriate local authority without delay.
(In Japan, the exemption is not written in aviation law, but in the penal code)
Article 37 (1) An act unavoidably performed to avert a present danger to the life, body, liberty or property of oneself or any other person is not punishable only when the harm produced by such act does not exceed the harm to be averted; provided, however, that an act causing excessive harm may lead to the punishment being reduced or may exculpate the offender in light of the circumstances.
United States of America
14 CFR 91.3(b) In an in-flight emergency requiring immediate action, the pilot in command may deviate from any rule of this part to the extent required to meet that emergency.
14 CFR 135.19(b) In an emergency involving the safety of persons or property, the pilot in command may deviate from the rules of this part to the extent required to meet that emergency.