Definitely yes!
You can call WinAPI functions directly from NSIS using System plugin, but it is difficult.
Create plugin using C/C++ that is the easiest way.
Pass parameters between plugin and NSIS via Stack.
NSIS has great support for it!
Plugin can be called with parameters and Pop hem in plugin [keep order!]
Use Pop in you NSIS code to get data from stack pushed by plugin.
MyPlugin::Start $0 $INSTDIR "Hello" 1245
Pop $0 ; result from plugin