Boston is among more than 170 Massachusetts cities and towns where local ordinances set 21 as the minimum age for purchasing tobacco, according to a tally kept by Tobacco 21, a national organization that supports the higher age.