I'm so sorry to hear about this, and can understand you thinking about the situation you were in.
When a dog has a mask on to breath- they are breathing 100% oxygen, rather than air (about 20% oxygen) so the oxygen intake is massively increased compared to normal breathing- so this will have been far better than the low oxygen state his body will have been in due to the fluid in his lungs- he probably just didn't like the mask on his face- most dogs don't- it was the right thing to give him oxygen- it will have provided some relief despite him getting stressed.
He most certainly won't have been in pain, and the oxygen will have helped him at a time when he would have been severely hypoxic (oxygen deficient) so he was in a better place on the oxygen mask than off it.
I'm so sorry for your loss, but your actions did actually prevent him from suffering.
Yes- the same will apply- but they probably added in a 'broncho-dilator' to open up the airways, this is usually a steroid type drug, the same as in a human inhaler (salbutamol). Because his lungs were full of fluid, he wouldn't have been able to get enough oxygen from the lung into the blood stream- i'm so sorry for your loss.