The attacks in the Middle East have raised anxieties elsewhere, as residents of communities near U.S. bases the world over worry about becoming the target of external aggression.