It's not technically hereditary. But if the job licenses are a finite resource, and the licensee "owns" the license and is allowed to give/sell it to a person of their choice, and the job is reasonably pleasant/profitable... they're very likely to pass it on to their children, unless those children have other plans.
Pharmacies in Italy work much like notaries, although they obviously provide a much more useful service. My understanding is that in part of the US taxis work the same way, with limited # of "medallions" being treated as an investment.
It sounds like notaries are a different service as well, in the US a notary is a minor(very minor) government official whose primary purpose is to verify that the person signing a document is the person they are claiming to be. For the most part US notaries have little knowledge of the contents of that document.
In California (I think other states, but each state has it's own specific laws) the fees are fixed below a small set amount.
I was a but optimistic on my wording, But in the US they are not government employees(they are not paid any sort of salary) just citizens who are authorized to verify signatures(a governmental duty, which is why I called them minor government officials) and are are allowed to collect a small fixed fee for their effort.
FWIW in Germany in order to apply as a notary you have to be a lawyer and the number of notaries is very limited and they're lifetime positions. As with all public officials, there are severe penalties for professional misconduct and losing your lifetime position and benefits is usually enough of an incentive to keep these people honest and careful.