In Bitcoin, you can use an OP_RETURN output to encode arbitrary data into a transaction output.
But there are also ways to do that without actually explicitly saying something is arbitrary data. For example, you could cut up the data into 32 byte slices and claim it is a public key. To an outside observer, it very well could be a public key. So then the person encoding the data creates a lot of P2PK outputs or a large bare multisig output with public keys which are actually the data.
In order for data to be put on the blockchain, it typically has to be transformed in some way (e.g. slicing it up) and it has to be interpreted specially in order to get the encoded data out. That someone has encoded illegal information into the blockchain is not a new idea, but in order to actually get the illegal information, you need a special decoder, otherwise it is just arbitrary bytes.