Evolution does not strictly apply to living organisms.
Natural selection, which is what I think your referring to, as a mechanism for evolution relies on Mendelian inheritance.
The only requirement for Mendelian inheritance is genetic material (DNA or RNA), which viruses obviously have.