How can we add an attachment control in a Nintex form of a document library?
You will not be able to add an attachment field to the form in a library as a document cannot have an attachment.
I would recommend using a list and attaching multiple documents to that list item, then using the "Copy Document" ("Copy to Sharepoint" for on premises) action to extract the attachments to a separate library, possibly into a specific folder or adding metadata for grouping. See Dan Stoll's 5 minute video on how to achieve this: Copy List Item Attachments to Folder.
Retrieving data ...