In Hungary, no. Because you only commit perjury if you are under oath on the stand as a witness.
You are not under oath simply defending yourself. As my lawyer said to me once: you can say or lie literally anything you just want.
This is common in European countries, but in the US and other common law countries, defendants who choose to testify are under oath like any other witness.