It's wrong to rely on theory. But it does no harm to know some.
The point is, anything you play that you think sounds good will be obeying some theoretical rule or other. You just (probably) don't know what it is (yet).
Theory is written AFTER musicians decide on what sounds good. This principle goes way back to Ancient Greece and probably before. Musicians always worked out what they liked by trial and error, and then theorists came along later and worked out what the underlying rules were - purely in order to save subsequent beginner musicians the same trial and error process.
What then happens is that following those rules proves boring in the end. Music depends on a mix of the familiar with the fresh or surprising. You have to follow SOME rules. But the trial and error process is also crucial - we always need to refresh things, break boundaries. So the theory gets re-written, eventually - but always lags behind what musicians are doing.
We play guitars, right? With frets? That means equal tempered tuning. It sounds wrong if we don't - because we're breaking fundamental rules. OK, we bend notes sometimes. But only certain notes, to certain amounts, or only at certain times.
Many of these rules we follow are intuitive. They're no less rules for that. They could be written down and learned. (Rock music is FULL of rules; it's an extremely conservative genre. It was rebellious and new in the 1960s, but has barely changed in 30 years... but hey, if it ain't broke...
But within those basic rules, things are more flexible - and were always designed to be. (Chords don't HAVE to go in a certain order - unless you want to make a certain recognisable form of music...)
At the same time, all forms of popular music have depended for their vibrancy and constant development on musicians who have learned purely by ear - by copying their heroes. This applies to jazz as much as it does to rock, blues, folk, country, whatever. We learn the rules the same way we learn to speak - by copying those who already can. A child learning to speak doesn't need to learn grammar from a book - he/she learns it from listening to how others use words.
Same with learning music. The rules (grammar) are already there in the music. We know what's correct, without having to read about it.
We also discover (later) how far we can bend the rules (to be creative) before the whole thing stops making sense.
But learning theory is not a bad thing, if you're curious. If you know how a car engine works, does that make you drive worse? Nope. It won't make you drive better either, of course. You can drive perfectly well without knowing anything about the engine. But if you do, and something goes wrong, maybe you can fix it...
The mistake people make is to imagine that theory is "laws" that we have to follow. It isn't. If you let theory inhibit your playing or your creativity, that's your fault, not theory's fault.
There's no Theory Police. YOU are the law, because your ears are the judges. And your ears have been trained, whether you know it or not. (Of course, some ears are better trained than others...