Is a found SD card safe to use after formatting it with a DSLR?
Unlike USB, an SD card is block-oriented storage, so connecting it to your system is roughly equivalent to adding a SCSI, SATA or IDE disk. It can't pretend to be a non-storage device, so BadUSB attacks are not possible.
This means the attacks it can perform require the user or OS to be tricked into running stored code - see Can a virus on a flash drive run itself?.
I'd still shy away from entrusting my precious photos to media of unknown provenance - but more due to the risk of data loss from a card that is excessively used, or has been exposed to harsh environments (temperature, radiation, whatever).
While it may or not be safe, consider asking yourself how much is the trouble worth? If it's more than the cost of a new SD card, you're better off chucking that one in the bin and buying a new one.
No, files generally can't just execute themselves, and generally can't exist beyond a low level format
BUT
It's possible that there is some exploit that you/we don't yet know about which does exist in maybe the partition table of the SD card, or similar.