I think you would be better off getting a Mac Mini and a monitor, and would not get a M1 iMac with the intentions of using it as an external display to your work laptop.
If you already had an iMac and wanted to use it as a second display to another device, there are options for you, but none are as good as a native monitor. Getting a new iMac for the purpose of using it as an external display for another device is just a waste of money, imo.
If you want an iMac quality monitor, there are options.
Thanks, I assumed target mode is still available on the new iMacs.
It was available for some of the Late 2009 to Early 2014 iMacs. Apple removed the feature for the 4K and 5K iMacs due to a HW limitation with TB2, but there was no reason they couldn't of brought back Target Display Mode for the TB3 iMacs and up.
I think Apple crunched the numbers and figured that having the feature, which would have been easy for them to do, would have cost them in sales of higher priced iMacs later on.
It is a shame, too. I own many iMacs, but will probably not purchase another one due to how wasteful they are once the HW performance no longer meets my needs. It has a beautiful display, that could continue to be used long after it gets too slow for my needs, but Apple doesn't see it that way. So many end up getting recycled or trashed, when they could be repurposed as a display for another device. I guess the environment only concerns Apple when it also helps their bottom line.
A maybe worse solution is screen sharing. Worse only because it is laggy.
I use Share Sharing daily with many different Macs from my main Mac, and it isn't that laggy if you have a wired network connection. It isn't as good as a normal display, but in full screen mode, it is basically like using that other Mac.
This could be an option for the OP with an iMac, but I would still recommend a MM and a monitor over an iMac.