Contracts that can send arbitrary transactions through some protocol, like Governor and TimelockController, should contain the required hook to receive ERC721 tokens via safeTransfer (which we implement in ERC721Holder).
I think there is a similar hook for ERC1155.