Do both SH51 and SH56 cleats work with all SPD-compatible pedals?
Yes, all SPD pedals are compatible with both of these cleats. The multi-directional release SH-56 will allow you to pull out of the pedal vertically if it is required. They are designed for spin bikes. (Exercise use.)

The difference is a preference only, because it depends what you intend to use them for. I will not use the SH-56 on the road because I have pulled out of the pedal during normal riding, and offroad has similar issues.