A better analogy for DNA in computer science would be LLMs. Each organism's DNA represents an experiment being performed in service of training a model. If that experiment manages to procreate, its successful mutations graduate into another round of experiments.
This has gone on for several billion years, resulting in a largely stable model within which experiment are continuing to be run.
As with LLMs, DNA doesn't know anything about the data it is being trained on ("Nature"). And that model continues to change even as the experiments are run.
So DNA is a "blockchain" record of previous and current hypotheses on which traits enable an organism to live to viability. Some of these hypotheses are "dead code," as the environment no longer contains the pressure which made them critical. Some of them are essential to viability. Some of them are experiments whose value has not yet been determined.
Assuming your question is whether IaC could learn from patterns in DNA, I think that's a very interesting idea. Certainly we desire that every loadbalancer, database, and iam policy be capable of self-defense, and be the hardiest, most fit version of itself possible.
Where the analogy struggles is that people writing IaC are more in the business of designing "natures" than they are designing individual organisms which would survive a chaotic and hostile "nature" being enforced on them. And people who write IaC might be unhappy to hear that getting to a "viable" database would require launching several thousand databases in an environment and, after some period of changes, seeing which one is performing best so they can clone that "best" database configuration when new databases are needed.