Had wondered this on couple threads and finally got confirmation when I was present at an attack on my starlight drive in settlement.
Can't quite confirm they traverse 360 degrees (e.g. ability to traverse 180 degrees behind in left or right arc to effectively give 360 degree angle of fire), but I saw two HMG turrets turn more than 120 degrees from their centered normal placement angle.
The slow scanning traverse you see when placing an HMT turret is ~90 degrees, 45 degree arc to left and 45 degree arc to right of where ever you centered turret. When my starlight drive was attacked just now with me present, I saw two of my turrets angled away from the main road that leads into the settlement turn at least 120 degrees and fire on the mutant attackers.
So not quite sure if they can turn all the way around to fire behind them, but I believe they can't and have a blind spot (sanctuary turrets at bridge with mobs directly 180 degrees behind them did nothing) - but they have a lot more angle of traverse than the slow scanning shown when you place them.