There doesn’t seem to be any law of that sort, however there’s some reports online, which indicate, that this is a common occurrence. See for instance this news report talking about Qantas.
More generally air crashes and the like seem to be avoided in in-flight programs. Although I once watched a documentary on a Singapore Airlines flight which went into great lengths about the dangers of counterfeit airline parts and their involvement in the Concorde crash.
Other than that, airlines also seem to edit out content which they deem potentially offensive. To quote from an article from road warrior voices:
For example, nudity and profanity in a film might be okay on a flight to Europe, whereas more discretion is practiced in the Middle East where nudity is not tolerated. In some Middle Eastern countries violence is totally acceptable, but scenes that involve pork products or pigs in any way, shape, or form hit the editorial chopping block because they might offend Muslim passengers, Toh said.
Credit:stackoverflow.com‘