In general, viral single-subunit RNA polymerases/replicases/reverse transcriptase shares a common origin with DNA polymerase. They have a conserved "palm" domain. Multi-subunit RNA polymerase forms an unrelated group. Primases have a more complex story: bacterial primases with the Toprim domain are related to topoisomerase and mitochrondrial helicase, while archaea and eukaryotic primases form a unrelated family, possibly related to the polymerase palm. Both families nevertheless associate to the same bunch of helicases.
^Loc'h, Jérôme (2016). "Structural Basis for a New Templated Activity by Terminal Deoxynucleotidyl Transferase: Implications for V(D)J Recombination". Structure. 24 (9): 1452–1463. doi:10.1016/j.str.2016.06.014. PMID27499438.