Is the mass of wood and oxygen that allow it to burn equal the mass of ashes and the gas given off during the burning?

Yes. According to the law of conservation of mass, the mass of all the reactants must be equal to the mass of all of the products.