In a matter of weeks, tech chief executives have gone from tentative efforts to work with Mr. Trumpdespite acrimony during the presidential campaignto taking a strong public stand on one of the signature policies of the first few weeks of his administration.