Hit and miss.
If it can be controlled by the camera's firmware, then it can be controlled by software. All it takes is a bug in the firmware, which is unlikely to ever be updated.
Some camera lights are controlled by the firmware, others are wired onto the data line, so the moment data is going either way, they light up.
However, defeating the light even in the directly wired case is possible, and has been done many times. If you fire up the camera, take a photo, and turn off quickly enough, the light won't be perceived by the victim. (I believe the FBI and the NSA both had tools that did this that became public knowledge a number of years ago).