If you are lucky the logic voltage ranges of the two devices may even coincide. For example 3.3V TTL logic shares the 0.8V and 2V thresholds for logic 0 and logic 1 transitions with 5V TTL logic ...
or very close for both “standard” 5 volt TTL and for low voltage 3.3 volt TTL, often referred to as LVTTL. While this would sound like they should then be able to connect together safely there ...