It looks like the "sh" step uses the same shell session that the Jenkins agent does when connecting a node to master. Therefore, any default shell configuration is determined in node settings, and changing it, or any of the dot files, requires reconnecting the node to reload them.
I would say it is a best practice to use a Jenkins Shared Library and define a custom step, which will use the "sh" step to run a specified command in a new "bash" login session. That way you can ensure the proper dot files, NVM etc. are always sourced fresh.