You have to realize that thermodynamics emerges from the bulk properties of matter, and this is seen better when one goes to the formalism of statistical mechanics. The first law of thermodynamics is the form conservation of energy takes in the thermodynamics mathematical framework which is constrained by classical physics.
As you must know from your chemistry courses, there exists the world of quantum mechanics, which is responsible for the existence of chemistry and its governing laws, another framework.
Special relativity has been validated experimentally many times over, and it tells us that mass itself is a type of energy .The law of conservation of energy, as @SWeko explains in his answer, includes the energy contained in the masses of the particles under consideration, the total energy being E=m*c^2.
In a similar manner where energy can be stored in chemical reactions, which can be released under appropriate conditions, energy is stored in nuclear reactions, of which fission and fusion are expressions.
In the realm of special relativity there is no meaning to the first law, because it does not describe nuclear reactions. Once the energy released by a nuclear reaction is taken into the equations then one can consider the thermodynamic properties of the sample resulting from fission or fusion.