If you are flying an aircraft for pleasure, it is certainly allowed to take photos. There is no rule against it. A good pilot does not allow anything to distract them when the right thing to be doing at a particular moment is aviating, navigating, or communicating.
In the past, older models of X-ray scanners were even more damaging to film, particularly high ISO films. However, most current machines used for carry-on luggage scanning use a very mild dose of X-rays that is unlikely to cause any damage to your film if it's under 800 ISO.
This is a common concern and people have been asking us for years. X-ray in airport scanners don't affect film that is already developed – digital photos, slides, and developed pictures aren't affected. But undeveloped film is sensitive to light because they are waiting to be exposed.
To a limited extent, yes. TSA is not law enforcement… it is transportation (airport) security. TSA's purpose is ensure that dangerous articles and substances do not get past the security checkpoint and onto an airplane. To that extent, TSA is allowed to search/inspect your belongings, including electronic devices.