Direct answer: Sometimes, but only when the manufacturer or reliable technical documentation identifies the newer board as a replacement for the older one.
A board that fits the box is not automatically compatible. Inputs, accessories, sensors, motors, firmware, voltage, connectors, and programming can change between revisions.
What to match
Record the operator model, serial/revision information, old board part number, and any accessories connected to it. Then check the manufacturer’s replacement guidance.
Do not move safety-device wiring to a new board by guesswork.