Yes, that’s true. It was his father that converted to Lutheranism.
Karl Marx himself was baptized in the Lutheran Church, and was presumably confirmed also.
But of course it did not “take”.
There are unfortunately many others with a similar course of life, even if they do not become famous radicals.