I'm plaing with Krastorio 2, AAI, Space Exploration and very_bz overhaul mods.
Foundry and Electric foundry buildings are not allowed to be placed in space.
But this mod with the other mods in very_bz modpack add a lot of recipes that can be smelted only in Foundry (alluminium alloys, steel, silicon, etc).
So there is no way to make all production in space sending only raw ores and fluinds from planets.
I think it is a good idea to allow produce Foundry recipes in some space buildings for example in Thermodynamics laboratory.