Consider a hydrogen atom, A, in the first excited state placed at a small distance from another hydrogen atom, B, in the ground state. Now, when A drops down to the ground state, it emits a photon which must have an uncertainty in its energy/frequency due to the energy-time uncertainty relation. And when this photon is absorbed by the other atom, B, the energy transferred also much have an uncertainty by the same principle. So how do we account for conservation of energy, when both the processes of emission and absorption have an inherent uncertainty in them? Is it not possible that there are small violations of energy conservation in each experiment, and that conservation works only on average over many experiments?
Yes the exact energy is uncertain but has a narrow distribution. It is all due to QM or probability, what's important is that the photon is emitted with whatever energy and that there are many hydrogen atoms where the electrons are able to absorb the quanta in its entirety. In your experiment ( which is interesting ) the rate of photon transfer would likely slow down if the hydrogen atom only had one partner atom to transfer too. Equally important would be the atomic spacing, the photon wave function likes (higher probability) atoms that are integer multiples of wavelengths a part. But in summary the absorbing atom takes all the energy, which turns out to be uncertain only because the emitting atom released it that way.
Conservation of energy is a fundamental law of physics that has to be obeyed in every single interaction.
In physics and chemistry, the law of conservation of energy states that the total energy of an isolated system remains constant; it is said to be conserved over time. This law means that energy can neither be created nor destroyed; rather, it can only be transformed or transferred from one form to another.
Now in your case, you are assuming that there is an otherwise empty universe, and two atoms in it.
Now one atom is in an excited state, and spontaneously emits a photon, and the atom relaxes to ground state.
It is a common misunderstanding that in QM nothing has a certain value, it is all about probabilities.
In reality, the energy levels of the electrons around your emitting atom are at certain energy levels as per QM. The difference between the excited state and the ground state is a specific energy difference, and that energy level is what the emitted photons energy level will be.
The probability is as per QM about the time, when this spontaneous emission will take place. The difference between the energy level of the excited state, and the ground state is a specific energy level.
That specific energy level will be the energy of the photon emitted.
Now in your case, there is another atom, the absorbing one. As per QM, if this absorbing atom has energy levels that have a difference that will match the energy level of the photon (and the photon propagates in space close to the atom), then the atom will probably absorb it.
In reality, absorption is just one way a photon can interact with an atom:
elastic scattering, the photon keeps its energy level, and changes angle
inelastic scattering, the photon keeps part of its energy and changes angle
absorption, the photon gives all its energy to the absorbing atom, and the photon ceases to exist
Now you are asking about conservation of energy. Energy must be conserved in all three cases.
In elastic scattering, the photon keeps its energy and only the angle of the photon will change.
In inelastic scattering, the photon keeps part of its energy, and gives part of its energy to the atomic system, and the photon changes angle.
In absorption, the photon transforms all of its energy to the absorbing atom (kinetic energy of the electron), and ceases to exist.
Conservation of energy is always obeyed in all three cases, when the QM system is a closed system.