Of course a “successful mathematician” (whatever success means in that context) can learn to program and may get to the top of the profession (again, whatever that means, which is not really clear to me). Anyone might do that, mathematician or not. No one can predict who, mathematician or otherwise, will actually succeed at programming.
Stephen Wolfram might serve as a role model for a successful mathematician who also contributed useful high-quality software, and made a lot of money doing it.
If the question is can all of them - no. The skills required overlap but they are are different.