This is a kind of bumper sticker version or popular version of the modernized notion "matter can be neither created nor destroyed". And it is fairly commonly stated as well as taught. It is, however, grossly oversimplified if not outright incorrect.
First, conservation laws, such as the conservation of energy or mass or momentum or what have you, strictly speaking only hold for systems in isolation. In fact, as a rule one of the primary operational methods for determining whether or not a system is in isolation is the assumption of conservation laws such that a supposed violation is interpreted to be the result of insufficiently isolating the system.
True, it may be said that the universe is an "isolated" system in some sense, but since any empirical support for conservation laws comes from assuming that we can sufficiently isolate systems within the universe, these cannot be extrapolated to hold for the universe.
Second, both energy and matter can be created an destroyed. They can even be created and destroyed in ways that violate fundamental conservation laws, so long as the duration of the violation is is small enough (loosely speaking). The creation and destruction of matter/energy is the principle form of interactions in QFTs including those underlying the standard model.
Finally, after a long history of having to modify the metaphysical, philosophical, and physical understanding of this notion that matter/energy can be neither created nor destroyed, modern physics expresses our best understanding via the links between conservations and symmetries in the equations of particular theories or frameworks.
The relevant part of this is that energy, for example, is strictly speaking only conserved when it is well defined (which is not the case on cosmological scales), and then only by definition. There cannot be violations of energy conservation in physics for reasons that are mathematical (and, again, whether one interprets actual, observed violations as being evidence for "particles" without charge in HEP experiments or whether one understands violations of conservation laws in QFTs as being somehow acceptable because these entities and associated quantities are necessarily somehow "virtual" and can be ignored, we nonetheless allow for various violations of fundamental conservation laws in modern physical theories provided they either have a phenomenological interpretation as in the case of neutral particles that can only be detected this way or through fluctuations on very small scales that we require based on even more fundamental principles from quantum theory).