After Samba installation, I got "smbd: Failed to initialize the registry: WERR ACCESS DENIED" in logs

The smbd process most likely runs under the nobody user or something like that.

The "registry" we're talking about is the file registry.tdb, it may be located in /var/lib/samba, or some other place, depending on your installation, and is not writable by the smbd user process. To fix the problem, you have to make registry.tdb writable by the smbd process one way or another, but be warned that this likely will weaken the security of your system.

The safest way in my opinion is to

chown nobody registry.tdb
chmod 660 registry.tdb

(given registry.tdb has root group). That is, give registry.tdb to the user nobody, letting root write to it through its group. It's safer than putting nobody in the group of root or something that will make many files accessible by nobody.