You want to focus on the Flange Focal Distance (lens flange to focal plane). You also want to get this right to a fraction of a mm.
The FFD of Nikon F mount DSLRs is 46.5 mm; that of Canon EF and EF-S mount DSLRs is 44.0 mm.
You should try and match this exactly, subtracting, in each case, the sensor to front plate depth of your camera. It's best to buy an adapter specific for your lens type and camera. ZWO offers Nikon and Canon adapters for their full-frame ASI cameras (17.50 mm sensor depth from M54 x 0.75 mm tilt plate):
A diagram for these is shown below. Note that they make the adapter length slight less (~ 0.2 mm) than a simple FFD - 17.5 mm calculation would indicate; that is to allow a bit of forward movement of the tilt plate to allow for tip-tilt adjustment. If you don't need to adjust the tilt plate, a thin shim between the tilt plate and the camera body can be added. That would be 0.2 mm for the Canon adapter, and a different value (no idea why) of 0.18 mm for the Nikon adapter. 0.2 mm would work fine for either case.
Now the above doesn't take into account any use of a filter between the lens and the camera. Introducing a filter shifts the enses focal plane further back, and requires that a shim be added to increase the adapter length. A good rule of thumb for this is that the shim (which can go between the tilt plate and the camera body) should be one third the thickness of the filter.
And there is one last twist to consider. Many camera lenses lack a manual aperture adjustment ring. While there are tricks you can try to set the aperture on a DSLR and then switch to the astrocamera, the best solution is to purchase a dedicated adapter that is also a USB ASCOM lens controller. This allows software control of both aperture and focus. The best option here, at least for Canon lenses, is made by Astromechanics:
Note that these adapters assume that you use about a full mm of the tilt plate to camera body adjustment. A gasket of some sort will be required in that case to prevent any stray light from reaching the sensor. I am eagerly awaiting the release of their new Canon full frame lens controller for my new ASI6200MC; this is due out in the next few weeks.
Hope this helps!
All the best,