If I have a hollow metal box of length $l$ and thickness $x$, I heard we can calculate the volume of metal used as $6l^2\cdot x$. But if we calculate the volume of metal in this manner, by multiplying surface area with thickness, is not the volume of the corners getting counted twice?
This looks like a cube rather than a cuboid. The volume of the corners is counted three times and the edges counted twice (though if you subtract the volume of the edges, you then need to add back the volume of the corners). There is a slightly easier way of avoiding this inclusion-exclusion calculation:
The total volume is $l^3$ and the volume of the space inside is $(l-2x)^3$
making the volume of the metal $l^3-(l-2x)^3 = 6l^2x-12lx^2+8x^3$
which is slightly less than $6l^2x$, but not by much if $x \ll l$.
What about area of a square metal frame with the outside lengths = $l$ and thickness = $x$?
The area of the metal frame = $l^2 - (l - 2x)^2 = 4lx - 4x^2$
If we now take this metal frame and extend it into the 3rd dimension, what happens?
$Volume = Area \times Height$
Volume of part of the metal cube that now forms = $(4lx - 4x^2)(l - 2x)$
Volume of the two slabs (bottom and top) = $2lx^2$
Total volume of the metal for this cube = $(4lx - 4x^2)(l - 2x) + 2lx^2 = 4lx^2 - 12 lx^2 + 8x^3$
Yes we would have to recognize the internal surface area is different than the external(assuming the box has square corners). The true volume could be found by the thickness times the average of the external and internal surface area. However you will find this is a considerably small difference when the box has a low thickness in proportion to its surface area.
Check out this link "https://rechneronline.de/pi/hollow-cuboid.php" it goes over how the internal side lengths are found from the thickness for a cupoid.The same process is used for the closed surface cube.