That’s not very secure, giving a :latest container access to the docker socket…
As for :latest, that depends on the push policy of the container owners. NextCloud only pushes stable releases to :latest so it's probably fine. There's no reason a :v123 tag would be any more or less secure than :latest.