Russia’s invasion of Ukraine failed to knock the major averages on Thursday, with the Dow, S&P 500 and Nasdaq Composite finishing the day with gains.