In most modern operating systems(OS), physical memory is not allocated directly by individual processes. Instead, a virtual memory layer is placed between the process and the physical memory, and is maintained by the memory manager of the OS. That virtual memory layer represents a mapping from a virtual address space to physical memory, and it is used to provide some security, along with the abstraction that each process has the memory to itself. (unless some multiprocessing scheme is utilized)
When checking whether a process can access a certain part of its virtual memory, the OS basically finds out if the address provided by the process is deemed accessible in the virtual memory space of that process. (Note that the address process has does not even have to be the real address on the physical memory) If the address is not deemed accessible within the virtual memory of that process, then a segment violation(SIGSEGV) is thrown.
That being said, do keep in mind that memory management in operating systems is a long conversation with many details and OS-specific implementation differences. My answer was only a generic one that is correct in most cases, and for further, more detailed information you should look into one of many books available studying the topic of operating systems.