@Abcd The driving force for the second reaction, as estimated correctly earlier, is the completion of the octet at the expense of another's.
Oxygen is in the IInd period and it is not happy when there is a vacancy in its outermost shell, i.e. the L shell, i.e. the 2nd shell.
Bromine, on the other hand, is in the IVth peiod. It is much more tolerant towards a vacancy (far away) in the N shell.