When you receive the error Couldn't modify partition map while erasing the drive with Mac's Disk Utility, you can repair the drive and try to erase the drive again in multiple ways.
"The disk you inserted was not readable by this computer" won't let you access the drive data. As you said the USB drive was used as a Linux boot device, the file system could be incompatible with macOS or some other reasons make the error message pop up. However, Disk Utility won't let you erase hard drive and returns the "couldn't modify partition map" error, then the USB drive should be corrupted.
What you should do is repair the USB hard drive:
- Repair the drive with Disk Utility's First Aid.
- Repair the drive via Terminal commands diskutil list(check the disk number)and diskutil repairDisk diskN(replace N with the disk number).
- Access Disk Utility in macOS Recovery Mode.
Now, try to erase the external drive connected to Mac again:
- Format the drive in macOS Recovery Mode.
- Erase the disk in the Terminal after booting into macOS Recovery Mode with commands diskutil list and diskutil eraseDisk File_System Disk_Name /dev/disk[disk number]
- Erase the drive with Safe Mode.