You made a purchase in good faith, and now you're overthinking it and worrying. No need for that.
Yes, there is a possibility the devices were ill gotten by the seller, but that's not on you.
If you can get them set up to be usable then all is well and move on.
If you discover that the devices cannot be configured for your own use because of Apple ID issues and/or security locks, then take this as a learning experience not to buy from questionable sources.
Apple isn't the hardware police and they won't be sending law enforcement to round you up. What Apple does do is make it difficult or impossible to use devices that haven't been properly released by their previous owners. It's a theft deterrent thing. Unfortunately, plenty of owners don't know the proper way to prepare an Apple device for transfer to a new owner, so even many legit transfers still result in the new owner acquiring a brick.
Always best to buy used Apple tech from respected resellers like macsales.com and macofalltrades.com.
You will also find refurbished Macs at reduced prices on Apple's own website: Refurbished Mac Deals.
❝Worry is a misuse of the imagination.❞ - dan zadra