Just as you can run any program on any machine given enough time and resources (memory), anyone not lacking intellectual ability can learn anything - some quicker, some slower.
And when it comes to software development, the actual writing code part of it, I'm confident you need to have a knack for it.
Mind you, there's plenty of jobs in software engineering that don't involve writing code. We're desperately looking for a manager for example, because our current "self-managing" team is far from effective.