Each organism on our Earth, except viruses, of course, has immunity.
The bacterium are always under the danger to be harvested by viruses – bacteriophage and the bacterium have the immunity against viruses also. One of the levels of bacterium’s immunity is CRISPR system. It is very similar to human’s acquired immunity; it allows bacterium to save fragments of viruses which it has faced. CRISPR system also helps to recognize the virus quicker and stop its actions.
However, the viruses are tricky guys and have its own antiimmune system. This system could arise by recombination of virus's and bacterium's genes. Such event occurs very often in bacterium but it is quite unlikely that such simple organisms like viruses have the antiimmune system.