Legacy transactions signed before EIP-155 use v 27 or 28 and can be replayed on any chain that shares the account; with EIP-155, the signing hash covers nine fields including chainId, and mainnet signatures have v 37 or 38. Typed transactions (EIP-2930, EIP-1559, EIP-4844, EIP-7702) carry chainId as a field and use y_parity 0 or 1 instead.
Chain IDs also matter outside transactions: EIP-712 domains, Sign-In with Ethereum messages and EIP-7702 authorizations include them, and a mismatch between the signed chain ID and the network a dapp is connected to is a classic warning sign.