In the United States and many other countries, engineering and medicine have revocable licenses to practice with an exam as well as the degree requirement. The same is true of other professions such as law and the CPA designation. It is presumably difficult-to-impossible to pass the examinations without the knowledge required for the degree.
Practicing such a licensed profession without the requisite license is a criminal offense, at least usually, but it is the absence of the license rather than the academic fraud that's illegal.
Generally what happens to (unlicensed) people who claim degrees they do not have is they get fired for lying on resumes. I suppose if one held oneself out to the public as having a certain degree and charged for practicing the skill implied by the degree, one could be charged with fraud. In fact, what likely happens is a civil suit for non-performance.
On the other hand Frank Abagnale did get imprisoned for fraud, although I believe it was the bank fraud, financial fraud, and forgery that nailed him and not academic misconduct, even though he both claimed a non-existent Harvard degree and impersonated a physician.