It is completely possible for any person to learn foundational knowledge outside of a formal instructional setting. I personally know excellent developers who have done so. It's unquestionably possible. I firmly believe that given sufficient time and determination and help, it's possible for any person to learn any subject to any level.
It is, however, possibly true that not all people learn discrete mathematics, relational algebra, and computer architecture in an ideal manner when entirely self-directed. Or perhaps even all developers.