‘a program’ is a bit too ambiguous for me to give a complete answer.
You should look into nzbToMedia, it’s a nzbget post-processing script.
What you could also do is perform the transcode in-place during a pp-script, Sonarr won’t try to import till nzbGet reports that the pp-script has finished.
The conversion program is MCEBuddy, it has a nice frontend that I can control the options of the transcodes that I use and also have different transcode options for TV compared to movies.