If I have two rectangular blocks, one iron and one wood, and they both have the same length, width, and height, then they both have the same volume.
The volume of a rectangular bock is V = (length) · (width) · (height).
The substance the block is made of isn't in that formula, because it has no effect on the volume. It doesn't matter whether the block is made of iron, wood, uranium, corn flakes, salt, air, or fried chicken. It doesn't even matter if the block is a rectangular region of completely empty space, made of NOTHING and with nothing in it. The volume only depends on its length, width, and height.