How do I know if part is compatible between manufacturers?
For these types of chips the numerical suffix (595 and 165) is the function. 595 is an output shift register, 165 is an input shift register. Definitely not interchangeable.

The HC part is the logic family, the technique used in the chip. Both candidates are the same, and HCT would probably work too.

What comes before the 74 is manufacturer-specific, and can mostly be ignored.

To summarize: your chips are not interchangeable.