I would use all three interchangeably, though as Jess points out, fool around, does another meaning, as does mess around to further add to her explanation about fool around, yes we use it when people not in a relationship partake in flirtatious or sexual behaviour, we also use this and messing around, when we talk about people that are being unfaithful to their partners.
Everyone knows his wife is fooling around/messing around behind his back with the office manager.