What version of retropie are you running? If you’re running retropie 3 rc1 it automatically configures your controllers for retroarch along with emulation station on first boot. See this page:
https://github.com/RetroPie/RetroPie-Setup/wiki/First-Installation
As long as the emulators are retroarch emulators it will work. Non-retroarch emulators have individual configurations that need to be done manually. Those are on their respective emulator pages on the wiki as well.