"Every code base I have ever worked on was a legacy nightmare. Every "greenfield" project I joined turned into a legacy nightmare within weeks"
I am sorry to say this, but it really sounds like you were either really, really unlucky, or part of the reason why it became a mess.
Complicated things are complicated. Nothing can ever change that and it requires study to understand it.
But it still does matter a lot, how one organizes the whole thing. How it is structured, documented(!), refactored. Are there competent people in charge who understand it all and kick peoples asses if they make even a temporary mess or forget to document, or do random people make changes wherever they see fit, because a deadline is ticking?
Modularisation is usually the key. Small modules do one thing and are as seperated as much as possible with as little side effects as possible.
And if one has to ship things, it is not always possible to keep it pure and if the code is not intended to live forever then this is often fine. But if the codebase is supposed to stay, then there needs to be the time to clean up the hacks. Or don't and then you end up scared touching anything.
That being said, the technologies you mentioned, I would not like to touch either..