Hi,
HIV mutations occur a lot and are completely random.
HIV has a RNA genome which, during replication, it must convert to a DNA genome. The enzyme involved is called reverse transcriptase and, unlike other enzymes involved in DNA replication, it has no proof-reading activity. This means that when copying the RNA to DNA it makes a lot of mistakes that go uncorrected. Therefore, when the DNA copy of the HIV genome is made it is different to the original RNA copy. Many different HIV genomes can be generated.
The mutations are completely random and so any region of the virus' structure can be changed. However, only those mutations that benefit the virus will be retained. This means if a mutation occurs in a region the virus uses to adhere to cells, the virus will be unable to adhere efficiently and will be unable to enter cells and replicate. These viruses will be selected against. A mutation in a region that is not involved in essential stages like adherence etc. may be useful to the virus and enable it to evade the host's immune system. Viruses with these mutations will therefore survive so this mutation will be retained.
Hope this helps.