President-elect Donald Trump has promised to invoke a little-known, 226-year-old law to deport some immigrants from the US.