It's really not a "config" — it a script file used to setup a router. So when you :export, that more "script generator" & :import similarly just a script runner. Only backup is "full copy" of everything.
As script, the order can be anything you want. Now if a called command references something else, that does need to be defined before using it. e.g. so an interface-list must be created before using it in a firewall rule. But when you an :export RouterOS it should produce correct order, but possible they have a bug.
If you login using MAC/winbox, and do an ":import verbose=yes myconfig.rsc" on no-default router, it will show you the line it fails on.
And over time there have been various bugs where an export is missing some [quasi-default] attribute or the like, and an import will fail since it's needed etc. So if you cannot import the same config back to the same router, at same version, after resetting it to blank... that's a bug.
How can I figure out what's going wrong in future attempts to import config blocks into ax2 if importing the config to the same ac2 with blank config, with the same ROS & packages fails?
Now in terms of transferring config from ac2 to ax2, there is no cookie-cutter way other than modify the original script manually. In terms of what to modify, you need to setup an ax2 with the desired config, and cut-and-paste that into the exported ac2 one for the wi-fi part. Essentially there is no config "migration" tool to adapt it automatically.