Yes, you could do as you describe.
I wouldn't personally do it that way... I'd still boot & use the internal SSD as primary, for the reasons
@Fishrrman stated - performance is better. You can store "Data" on the external, even with the user account on the internal.
There are a couple of possible ways to accomplish that; you
might still be able to use Migration Assistant but un-tick "Documents and files from apps." Chances are, that will remove enough of your 500GB to let it migrate successfully. Then you'll manually copy over your data to the external disk.
If that doesn't bring the size down enough for the new Mac, you might be able to also eliminate Apps from the migration; you'd have to reinstall your apps manually. Or you could go complete manual on the migration.
I agree. No need to make the external drive your boot-drive. Just use the already installed Sonoma system to store system, apps, and user folder and start using the 2TB external drive to store large folders. Those are usually photos, movies, and music folders inside your user folder. I've done this many times on internal drives as small as 128GB.
If you don't have a backup of the 500GB disk, first thing you do is create one. You don't need to learn about Time Machine or buy a backup app, just plug in your 2TB external and drag your user folder (MacHD/Users/yourname) to it to create a copy.
Having a backup of your user folder, you can continue without worrying about screwing up. That copy of the user folder contains everything you need to recreate your system if you need to.
On the 2017 imac, you want to empty the photos, movies, music folders and any other large folder that you don't want on the 256GB before doing the migration to the M1 imac.
You might want to establish which folders and files are taking up space first. You could check 'Get info' on the folders I mentioned, and with some mathematics you can figure out if emptying them will free up enough space to let the rest fit on the 256GB. You could also use an app like Daisydisk which lets you quickly get an overview of what's taking up space.
On the 2017 imac, empty the folders that you want to sit on the external and not the internal from now on, by moving their contents to the trash (You have a backup, remember), and you're ready to do the account import with Migration Assistant.
Do the user account import to the M1 imac. Full migration. Don't deselect anything.
Organize the folders on the 2TB the way you want them; ie a Photos folder, a Movies folder and so on and fill them with the contents of the backup you made. I would suggest you copy their contents, not move, but pressing and holding 'option' when dragging the data, so the backed up folder remains intact.
The Music, TV, Movies, Photos etc will now open without content, because they're looking for data in the default locations in the user folder that are now empty. You need to redirect those apps to the new folders on the 2TB, most apps have a preferences setting that allows you to select the new folders. You might also need to reload their catalogs/playlists, this is done by pressing and holding option at app launch.
This might seem convoluted, but it's how I would approach it. Anyway, it's completely possible to have system, apps and essential files on a small internal drive like 256, and use external storage for big data.
Btw, the term 'memory' is not used for disks, it's otherwise known as RAM (random access memory), while disks, drives, volumes are most often referred to as 'storage'.