Can I use a x-ray film instead of neutral density filter for photography?

to dim very bright objects such as sun

I would suggest a "leaky" mirror such as the ones from sideview mirrors from cars. The busted ones that I have disassembled are all leaky. ~Bob~
The biggest problem is that the film base will not be clear. It would be like putting dark wax paper in front of your lens. ~Bob~
If you want to shoot the sun, you're better off and safer with Baader film