in your case, if the new socket is level with the old one, and the cable runs horizontally straight between them, that is a "safe zone".
A safe zone is where a cable can reasonably be expected to be, so that only a numbskull would hammer a nail or drive a screw into it. You can be expected to see the socket or switch, infer that a cable must be present, and investigate or assume it to run in the wall.
A direct horizontal, or vertical, line from a visible socket or switch is a safe zone (there are some others). Diagonal or curved cable runs are not allowed.
In most cases, cables to light switches run directly upwards upwards the ceiling; socket cables usually directly upwards to the ceiling (if you have a concrete floor) or downwards (if you have a wooden floor). Where sockets are positioned close together (as in your case, or as in a kitchen above the worktop) then the cables can sensibly be run horizontally between them, as this is the shortest route.