How Could DNA Have Evolved?
While there is no direct fossil evidence for the evolution of DNA (because of its size and fragility), scientists have theorized on its origins based on verified laboratory evidence. One theory goes like this: DNA began as a simple self-replicating peptide, possibly containing no more than 32 amino acids, which formed naturally (and somewhat easily) in the early oceans of Earth.
Once self-replication had been achieved, the forces of Natural Selection took over. For example, those molecules which were protected from the elements survived longer and reproduced more. So, any molecules which found themselves with a lipid bubble (which also forms naturally) would have a better chance of reproducing. After many incremental steps, the lipid bubbles eventually became cell membranes, and the molecules DNA.
For more information on the probability of life forming this way, please see this article.