It depends from which country the airline is from. As some countries have not yet implemented the (non smoking on aiplanes law), cause it is a very long process.
So on most airlines it is just a policy. But that does not mean you could legally start smoking away while on your holiday trip to who knows where. Cause the airline could charge you with endangering the safety of the airplane and it's pax. Especially tampering with the smoke detector in the lavatory will definitely get you in alot of trouble. So my advice.. don t bother trying! Especially if you re on my flight !
Cheers.