In the addition of HBr to isoprene why does the less stable carbocation form? According to me, the answer is B as the tertiary allylic carbocation should be more stable. But the answer given is D and in the given solution, the tertiary allylic carbocation rearranges to primary allylic carbocation to yield Option D.

My question is why does rearrangement from tertiary allylic carbocation to primary allylic carbocation take place?



Source: JEE Advanced 2015 Paper 1 Q31
The carbocation will be formed as per stability rules but as it is conjugated system the cabocation resonates and as the less stable carbocation is more reactive  it is attacked by Br-