In the four dimensional spacetime of field theory, which is where virtual particles live, Energy is one of the four momentum components: p_x, p_y,p_z,E . In this fourvector space , actually a pseudovector space because a minus sign enters between the fourth and the rest of the coordinates:
the dot product of the vector with itself is its scalar measure, analogous to the length of the three dimensional vector in the normal three dimensional space. This scalar number in "real" space is fixed and unchangeable. In "virtual" space it can change according to the mathematical formulations of the Feynman diagrams describing the interaction.
Virtual space is a mathematical tool for complicated calculations and is constrained only by mathematics, not physics laws like energy conservation. This is because one can never do an experiment in virtual space, by construction.
As @DavidH comments to you the HUP is another story, it is a general uncertainty in the possibility of measuring some pairs of variables, well defined, as for example energy and time. If you measure the energies before an interaction well the energy should be conserved after the interaction. The HUP would just constrain the knowledge of how long the interaction took within the uncertainty limits. It is not the HUP that is generating virtual particles, but the specific calculations of interactions.
You may be thinking of vacuum fluctuations, but these are virtual, unless there is an interaction, i.e. energy is supplied by an interacting particle. Otherwise we would be able to get energy out of the vacuum :).