Obviously, any RNA or DNA molecule can serve as a template for the polymerization of another nucleic acid molecule.
However the polymerization cannot proceed spontaneously. The nucleotides polymerize by condensation, i.e. by releasing water.
It should be obvious that such a reaction cannot be spontaneous when the molecules are already surrounded by water. You need some molecule able to extract the water from the nucleotides, for example an acid anhydride, like ATP.
That anhydride must have also been produced by water extraction and in the water environment you need an energy source for that.
So if you will complete the analysis you will reach the conclusion that you need an existing living being for the replication, no replication can occur otherwise.
Obviously, in a lab you can yourself substitute the role of that living being, by providing adequate supplies of monomers and of energy sources, so you can replicate nucleic acids in abiotic conditions. Nevertheless, that could not happen in natural conditions.