WASHINGTON—President Donald Trump said he was optimistic that an immigration deal could soon be reached on “Dreamers” and agreed with lawmakers to limit talks to four policy areas during a bipartisan meeting Tuesday at the White House.

Over nearly an hour, Mr. Trump offered various formulations for what an agreement might look like during...