The world will be on a “rocky path” if politicians “kowtow” to the likes of Donald Trump and Nigel Farage, former Scottish first minister Nicola Sturgeon has said.