Does the +2 hot-sim vr bonus apply on opposed/defense tests in the matrix?
Core rulebook, p. 230 (emphasis mine):
You receive a +2 dice pool bonus to all Matrix actions[...].
Since you're not using an action to defend, you're not getting the bonus. Even if you're using Full Matrix Defense you use the interrupt action to boost your defense pool, not for rolling your defense pool.
As for opposed checks: You'd get a bonus as long as what you're doing would count as action. However I'm currently not aware of any opposed test in the matrix rules.
Hot-sim [..] You receive a +2 dice pool bonus to all Matrix actions (Core 230)
There are three different kinds of actions in Shadowrun: Free Actions, Simple Actions, and Complex Actions. (Core 49)
Defending against hostile actions is not an action in itself. Thus you only get the bonus if you initiated the opposed test. For example when a decker in hot-sim uses hack on the fly against another persona also in hot-sim, only the decker will get the bonus, the target won't.