Why 1 mole of H2 occupied the same volume occupied by 1 mole of O2?
The volume occupied by a gas has no relationship to the size of the molecules of the gas
This is one of the principles of the gas laws in chemistry. It is based on observation: in the early days of chemistry it is what chemists observed to be true. And it is a very important chemical law.  But, of course, that doesn't explain why it is true.
There are several ways to gain some appreciation of this without too much theory. consider water as a liquid compared to water as a gas (I'm simplifying a bit but not by much). One mole of liquid water occupies about 18mL of space and this space is largely dominated by the size of the water molecule (again reality is a little more complex as the specific way the molecules interact makes a small difference to the volume occupied). As water vapour (the same substance but as a gas) 1 mole of water occupies over 22L of space (ignoring the fact that water is not a gas at STP, but bear with me as this is the space it would occupy if it were). That is well about 1200 times more space. This implies that very little of the space occupied has anything to do with how big the water molecule is.
The same broad idea applies to all gases.
So why does the molecular size not matter? A detailed understanding requires a fair few calculations about how gas molecules behave. But, the bottom line involves thinking about the molecular cause of pressure and the meaning of temperature. Pressure is caused by gas molecules bouncing off the walls of a vessel. Temperature is the average energy of those molecules which is a function of their speed and their mass. Doing the calculations shows the relationship between volume, pressure and temperature. This calculation explains the properties of gases but the volume of the molecules has no part.
Strictly speaking the ideal gas laws assume that the size of molecules don't matter. But this is a good approximation when the gases are far away from the point where they become liquids. The simplified theory matches actual observations well. And the fact that, in typical gases, the volume occupied by the molecules is less than 0.1% of the volume occupied by the gas shows why the molecular volume is usually irrelevant.