I think you need to research what pruning means.
Can only OP_RETURN data be pruned?
No — Bitcoin Core pruning cannot selectively remove only OP_RETURN data.
Pruning works at the block-file level: it deletes entire raw block files (blk*.dat) once they fall outside the configured retention window. That means all transactions and their raw data in those blocks (including OP_RETURN outputs, input scripts, signatures, and other fields) are removed together.
