Nikon, Canon, and Sony all make adapters to mount their SLR lenses (F-mount, EF-mount, and A-mount, respectively) to their mirrorless systems (Z-mount, RF-mount, and E-mount, respectively). Note that in some cases, not all lenses, or full lens functionality (usually, autofocus) is preserved or supported.
But generally speaking (with lots of little caveats for specific cases), you can use lenses from systems with long flange distances (e.g., SLR lenses) on cameras with shorter flange distances (i.e., mirrorless). But not vice versa.
A second concern is throat diameter — if the mount on a lens for a long-flange-distance system has a substantially larger diameter than the short-flange-distance camera's mount, there might not be enough space in the adapter to accept the wide lens mount and still be small enough to mount to the camera. This is very much specific to the pair of systems you're trying to interconnect.
These concerns are the same as when adapting from one lens brand to another brand's camera body. See Can I use lens brand X on interchangeable lens camera brand Y? for a more complete discussion of these issues.
Finally, while it's true that optically-speaking, all that's needed is just an adapter (assuming the flange and throats distances are conducive to being adapted), the electrical contacts and communication to the lens must also be adapted. When adapting between brands, that information is not available, so companies like Sigma, Tamron, Metabones, etc., must reverse-engineer the electrical and communication protocols. Sometimes they don't get it totally correct, so there winds up being some bugs or incompatibility issues.