They're not rules unless your teacher is an asshole.
Music theory is a language used to be able to have conversations about harmonic and melodic aspects of a piece of music. Rythmic aspects are less well supported (that's putting it mildly) by western musical theory, but the same is true there for whatever formalism or terminology/nomenclature you might pick: it's not a set of rules, it's a language to facilitate non-musical discusison.
Music theory is a language used to be able to have conversations about harmonic and melodic aspects of a piece of music. Rythmic aspects are less well supported (that's putting it mildly) by western musical theory, but the same is true there for whatever formalism or terminology/nomenclature you might pick: it's not a set of rules, it's a language to facilitate non-musical discusison.