Sortof. But with a few caveats. 1) most computer viruses don't randomly vary, and thus don't have a learning effect, miss unlimited heredity. 2) they are not physical life, so the relevance is not the same as their chemical counterparts.
I wonder what would happen if we taught a computer virus to modify itself without restriction.
Of course, most of those viruses would probably just be rendered inert, printing a lot of segfaults into the kernel console.