Allow me to expand on Erik's response:
To focus at infinity, it must be possible for the nodal point of the lens to be separated from the film plane by a distance exactly equal to the lens focal length. For example, the nodal point of a 50 mm lens will be exactly 50mm away from the film plane when focused at infinity. As the lens is focused on a distance closer than infinity, the nodal point moves further away from the film plane. As a result, there is the familiar macro rule that when a lens is focused on something very close, such that the image size on the film is exactly the same as the subject size, the lens nodal point will have moved a distance away from its infinity position equal to the lens focal length. That is, the nodal point will be a 2x focal length when the lens is focused for a 1:1 reproduction ratio.
The problem any time you place an adapter between the camera body and the lens is that the thickness of the adapter increases the separation between the lens nodal point and the film plane. Hence, you are likely to lose the ability to focus at infinity if you use an adapter to install an M-42 lens on a modern bayonet camera.
The one possible exception is if the diameter of the camera bayonet mount is significantly larger than the mount diameter of the off-brand lens you are trying to use on the camera. In those instances, it may be possible for the adapter to be designed such that the lens attachment is recessed sufficiently into the body of the adapter to make up for the thickness of the adapter.
Many years ago, I inherited a Konica TC camera. I was using Nikons at the time (still do). Because the opening in the Konica body was sufficiently larger than the rear diameter of Nikon lenses, I was able to find a ring that allowed me to mount a Nikon lens on a Konica body and retain infinity focus.
Unfortunately, my recollection is that most proprietary bayonet mounts have a diameter that is not significantly different from the diameter of the ubiquitous (or at least, used-to-be-ubiquitous) M-42 mount.