BERLIN—German Chancellor Angela Merkel said she wouldn’t budge from her policy of accepting refugees despite two terror attacks by asylum applicants in the space of a week.

Ms. Merkel, interrupting her vacation on Thursday to hold a news conference in Berlin, repeated her “We can do it” mantra from last August, when thousands of migrants seeking asylum were entering Germany daily.

That...