BOSTON—The possible arrival of Amazon’s second headquarters here is triggering both hopes and apprehension in a neighborhood already dealing with fallout from surging costs in a growing city.

The city has pitched East Boston, an immigrant-filled area of about 46,000 people, as a prime locale for Amazon.com Inc.’s next home. While developers say gentrification came slowly there, it is now in full swing, aided by a subway line under Boston Harbor offering quick commutes downtown.

Rising...