What century of katana are you speaking about? Many katana were used with modern metallurgy technology and imported steel. Do you think modern Japanese created cars are also made from steel refined from sand? Do you think the guns Japanese Samurai used were made from steel refined from sand?
Impurities are melted into slag. Not the iron. That’s what slag is.