Well the standard Intel cooler for i3/i5/i7 sandybridge and previous i3/i5/i7 core duo etc, is a round shape with a fan on top blowing downwards.
There are four push pins set equal distances around this circumference to secure the cooler to the motherboard.
So as you can picture you can rotate the cooler and the four push pins will still line up with the holes.
Aftermarket heatsinks still use these four holes to clamp through, and can be rotated to face any direction, the only thing stopping fitment anyway you want would be components on the motherboard around the cpu socket that are tall in height (performance motherboards are covered in metal heatsinks in various shapes and sizes to cool the VRMs, chipset of the motherboard etc).