Hi
If I understand your question correctly, you want to dynamically create tabs, sections, and fields using javascript. In other words, you are trying to do on-the-fly form customization which is normally not recommended and not very straightforward to do.
Normally this sort of requirement fits into a web resource. In a web resoruce, you can dynamically populate content and do any thing you want.
I would recommend you re-think about your solution.
If you definitely have to dynamically display tabs and sections and fields, as LeoAlt suggested, you could add all the tabs and sections and fields and control their visibility using Javascript.
Show/Hide Tabs
Xrm.Page.ui.tabs.get("tab1").setVisible(true/false);
Show/Hide Sections
Xrm.Page.ui.tabs.get("tabnname").sections.get("sectionname").setVisible(true/false);
Show/Hide Fields
Xrm.Page.getControl('field name ').setVisible(true / false);
If this won't be very useful for your scenario, like I mentioned above, please consider using an HTML web resource and dynamically creating the content.
https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/create-edit-web-resources