President Donald Trump signalled during his state visit to Britain that military intervention could be used to deal with illegal migration to the UK.