* writing a lot of code,
* reading other people's code,
* evaluating and re-evaluating the code you've written and read,
* learning and using different paradigms, languages and tools, and
* being mentored by a great programmer who can teach.
And, not surprisingly, these are all things that nearly anybody you consider a "great programmer" would have done to get to that point.
Very few people who are not already inclined towards programming are going to be willing to put that kind of effort in. As a result, while I firmly believe great programmers can be trained, I think there are very few who actually are.
In the end, I'm not even sure that "trained" can even be used as a classifier. I think a better classifier would be "self-selection". So, can a person who has not self-selected to be a programmer become a great programmer? Can a person who has not self-selected to become a basketball player become a Michael Jordan? Genetics may say yes one in a billion times, but most likely not.
It may be easier for programming, thou, because you can spread those 10000 hours out over 15 years while still making a reasonable salary utilizing the mediocre skills you have today. Salary is a strong motivator, but I would be most people are willing to stay at the mediocre level.