Only some viruses work this way, HIV is an example. This is a good article on endogenous retroviruses [1], that is viruses that work by integrating themselves into host DNA (a retrovirus) and made it into germline cells (eggs and sperm, the endogenous part).
And to clarify for those reading this, HIV is not passed from mom to baby via inhereted genome, but as a blood borne illness in pregnancy, during birth, or in breastmilk.
The cells infected by these viruses don't form the sperm and eggs, so no. But a great portion of our genomes is thought to come from old viruses (which actually may be used immunologically!)