You're mixing up stories. Elon was in Moscow prior to founding SpaceX as he was attempting to purchase an ICBM to refurbish into a rocket to send a terrarium to Mars.
He settled on founding SpaceX on the flight back because after the oligarchs lead him around a bunch with no intention of actually negotiating a sale, they straight up spat at him.