Yes, by golly, I have heard a rumor about nuclear weapons, I was in the Air Force.
So, can you tell me what matter is created by the energy of a nuclear explosion? Since the OP refers to in the beginning and as far as I know, there were no nuclear weapons at that time so how did energy create matter, in the beginning? What was the source of that energy, what was the trigger?
Other way around, actually. Mass is converted into energy in nuclear weapons. That is why they have such a large yield.
But the conversion can, and does, go the other way also. For example, if you collide two electrons together at high energy (kinetic energy), they will often produce extra matter by conversion of the kinetic energy into mass. What is produced depends on the energy level of the collision, but it is quite possible to produce protons and anti-protons (which are each 1800 times as massive as an electron).
Once again, we do not know the specifics about 'in the beginning' (even whether such a phrase makes sense isn't clear). But we know from lab results that a 'pure vacuum' with no matter in it has a higher energy than having space with matter in it. The decay from one to the other is *thought* to be one aspect of matter creation early on.
Now, if you have a universe like those predicted by loop quantum gravity (again, speculative), then there is a prior, contracting universe before ours and a 'bounce' that goes into ours. So, in that case, the energy and matter are at high compression at the 'bounce', but exist through it.