Walking: keep right. Most people appear to have a natural tendency to keep to the right. Right-handed swordsmen, however, may prefer to keep to the left in order to have their right arm nearer to a potential opponent, and to reduce the chance of the scabbard (worn on the left) hitting other people.
Riding a horse: keep left. A right-handed person finds it easier to mount a horse from the left side of the horse, and it would be very difficult to do otherwise if wearing a sword (which would be worn on the left). It is safer to mount and dismount towards the edge of the road, rather than in the middle of traffic, so if one mounts on the left, then the horse should be ridden on the left side of the road. Horsemen armed with swords prefer to keep left of each other in order that their sword arm is nearer their opponent -- and, more often, to offer one's right hand in friendship.