Section 14. The aldermen of a city or the selectmen of a town in which pipes or conductors of such company or corporation are sunk may regulate, restrict and control all acts and doings of such company or corporation which may in any manner affect the health, safety, convenience or property of the inhabitants of such city or town.