Bitcoin cash is a hard fork of bitcoin which means that before a certain block number (478558 according to Wikipedia) the blocks are the same for both bitcoin cash and bitcoin. I was looking at one of these blocks before the hard fork using a blockchain explorer (Blockchain.com) and I noticed that all the information seems to be the same apart from the transaction addresses. It seems like the bitcoin and bitcoin cash addresses are different even though other information such as the block hash and Merkle root hash. What is the reason for this?
Addresses do not exist on-chain. In fact, they don't exist at the protocol level at all, but are a human representation of the "script" language that is used internally. Bitcoin Cash uses a different human-readable representation for the same scripts.
Transactions have outputs, and every output is "locked" by a script that specifies the conditions under which that output can be spent. Those scripts are the ones that end up on chain.
The more common classes of scripts have associated human-readable encodings, called addresses. In particular, P2PKH (pay to public key hash, 1... addresses in Bitcoin) and P2SH (pay to script hash, 3... addresses in Bitcoin) do. However, many possible locking scripts exist that could feasibly be used on-chain have no corresponding address at all in Bitcoin. Of course, it would be hard to make someone send to them, as there is no address you could give the sender to pay to, but in theory, nothing prevents people from manually constructing such outputs.
Early after Bitcoin Cash's fork, they used the same address encoding as Bitcoin. This was a problem, as it caused confusion, and resulted in people sending coins on the wrong chain, by simply inputting the address in the wrong software. This was later addressed by introducing a new address encoding. It also means that it now "looks" like those pre-fork and early post-fork transactions used that new address scheme as well.