First of all, as many have already said, saying that something "doesn't have mass" will lead most physicists to think about things having zero mass, so it is better to talk about physical systems with undefined mass. (This is equivalent to saying that, if I tell you that I don't have any money, you will understand that I have 0 dollars onin my bank, not that money is undefined.)
Any wayAnyway, I should disagree with @John Rennie's answer, saying that mass is always defined.
The first example that comes to mind is in quantum mechanics. In quantum mechanics, a particle can be in a superposition of states. A practical conclusion of this is that, in general, quantum states don't need to have, e.g., a well-defined energy. Thus, if you construct a quantum state that is a superposition of two mass eigenstates with different masses (states with well-defined unequal masses), then this new physical state won't have a well-defined mass. Now, there might be some rules that forbid physics to construct such a state (these are known as superselection rules). According to Weinberg (Section 2.4 of QFT Vol I book), if nature were invariant under the Galilei group, there would in fact be a mass superselection rule. However, we know our universe is not invariant under the Galilei group, and these undefined mass states are actually very relevant in particle physics. Probably the most known example are the neutrinos. The particles* known as "electron neutrino", "muon neutrino" and "tau neutrino" do not have a well-defined mass.
*Whether we can call a "particle" to a quantum state with no definite mass is a matter of terminology, which I will not discuss.
Another example of a physical system with undefined mass could be a macrocanonical thermodynamic ensambleensemble. This is quite equivalent to what you mention about temperature. In the macrocanonical ensableensemble, the system doesn't have a well-defined number of particles and thus doesn't have a well-defined mass. (Of course, in this case, you can say that the combination of the macrocanical ensambleensemble and particle reservoir does have a well-defined mass.)