There’s no doubt Marx was heavy into Hegel.
So was pretty much every 19th Century philosopher, especially in Germany.
Dialectics go way back, Plato, Aristotle... If Marx had also taken up Hegel’s view on God and spirit, etc., Marxism wouldn’t be Marxism. Marx took Hegel and others and made it into his own philosophy. It’s not the same as Hegel’s.