Yes the airline and the airport both have the authority to inspect your baggage. I suppose you could simply leave the airport and withdraw your baggage if you decided you did not want it screened.
Typically you agree with the carrier at time of purchase something like this
RULE 25 REFUSAL TO TRANSPORT
Delta may refuse to transport any passenger, and may remove any passenger from its aircraft at any time, for any of the following reasons: (…)
B. Search Of Passenger Or Property
When a passenger refuses to permit search of his person or property for explosives, weapons, dangerous materials, or other prohibited items.
http://www.delta.com/content/www/en_US/legal/contract-of-carriage-igr.html
or
- Acceptance of Passengers
a. Refusal to Transport
General. Carrier may, in its sole discretion, refuse to transport, or may remove from an aircraft at any point, any Passenger in any of the circumstances listed below. (…)
(5) Search of Passenger or Property. Any Passenger who refuses to permit the search of his person or property by Carrier or an authorized government agency for explosives, hazardous materials, contraband, or concealed, deadly, or dangerous weapons or articles.
https://www.southwest.com/assets/pdfs/corporate-commitments/contract-of-carriage.pdf
or
8h) Our right to search, screen and x-ray you and your baggage
8h1) For reasons of safety and security we or our agents may ask to search and screen you and search, screen or x-ray your baggage. We will always try to search, screen or x-ray your baggage when you are present. However, if you are not available, we may search your baggage in your absence.
If you do not allow us to carry out the necessary safety and security searches, screening and x-rays, we will refuse to carry you and your baggage.
Interesting that the US examples are carefully phrased such that it is presumed you have already given consent; and that you agree not to interfere with their right to inspect your bag.
You are asking a company to transport your bag in a security-heightened climate. You cannot expect to shield the content of it from the carrier, whose employees and equipment bear the risk of your secrecy.
Credit:stackoverflow.com‘