Yes, it is definitely true that some Android viruses can root your phone and get installed as a system app which cannot be removed even by factory reset. Here I am explaining the ways viruses and Trojans can harm your system and what are the basic differences between the two.
Virus
A computer virus is a small program which is written to change the way a computer operates, without taking the permission of the user and doing the same even without his knowledge . A virus has to have two criteria:
It must operate by itself placing its own code within the path of execution of a different program. It has to replicate itself.
Trojan horse
Trojan horses are mostly impostors. They are files that appears to be something important, but, actually they are malicious. The major difference between a Trojan horse and true viruses is that, they cannot replicate themselves, as on principle the viruses do. Trojans would essentially contain malicious code, which, when getting triggered, would cause loss, or better called stealing of data. For a Trojan horse to spread, it needs you to invite these programs to your computers. for example, it can be as simple as opening an unknown email attachment.