Pulmonary edema, in general, can be caused by anything that damages the lung, and that includes corrosive or otherwise tissue-toxic gases. It is HIGHLY unlikely you would be willing to breathe anything bad enough to be likely to cause it -- this is the type of thing we see with chemical spills and house fires and the like.
Immersion pulmonary edema has been seen in swimmers, so there is no need to descend to depth to be susceptible to it. One of the theories is that it is volume redistribution in the body, due to water buoyancy and negation of gravity changes, as well as temperature changes.
As I said, we have one case here where symptoms were noted at the end of an hour's dive, although I do not know if she had any warning signs while underwater.