Some boiler models may create bubbles of steam inside that collapse when they hit cool water. Some boilers use controls that start the circulator after the water has become warm, making the creation of steam bubbles in still water possible before the circulator runs. This banging may be prevented by running the circulator at the same time the burners start.
A multi-zone system may also have the banging problem for the same reason when only one of many zones is open to allow a small portion (of the total water required to heat the whole house) to flow. In this case, water flow is too small to move enough hot water from the boiler. This may require a minimum boiler flow rate to always be available when the burner is on to keep the water temperature difference from the boiler inlet to the outlet less than 40-50F or less.