It's not possible to clear a building. Once you place down a factory building, the entity or item will always be connected to the same interior, and the interior will never stop existing even if you destroy or delete the building.
Hence, and also for some internal reasons, it's a much better idea to reuse factory buildings instead of discarding them and using fresh ones.
Also, without any other mods, factory buildings should not be stackable in the first place.