Sixteen states have begun legal action against US President Donald Trump's executive order restricting entry into the country for travellers from seven Muslim-majority nations, while thousands protest.