Assuming both are DDR4, both are the same form factor, appropriate voltages etc, the answer is still probably.
Give us part numbers. Even better, look up the motherboard manufacturer's list of memory that is tested to work with that particular board.