The conjugated dienes add the acids of the halogens forming kinetic and thermodynamic products, whose ratio can be controlled with the reaction conditions (temperature and time).

hx addition to dienos 01

Mechanism:

Stage 1. Electrophilic addition with formation of allylic carbocation

hx addition to dienos 02

Stage 2. Nucleophilic attack of the bromide.

hx addition to dienos 03