A 27-year-old immigrant from Bangladesh detonated a homemade pipe bomb strapped to his body in a crowded New York subway passage during the morning rush hour Monday, wounding three people and putting the city on edge just six weeks after a deadly truck attack.