I have two servers A and B, I setup federation between then and am syncing folders from server A to B, those folders appear in my nextcloud client, but are not synced inside server B, can it be done?
Within Nextcloud, this has not been implemented. Perhaps a first step would be to set up some caching that it speeds up file access. If you want really to sync stuff, handling the potential conflicts an become tricky.
If you want to sync over different sites, I’d also take a look at syncthing or git-annex. You can use a local folder which is synced with one of these and use them again by Nextcloud as “extrnal storage” if you really need it to be in Nextcloud.
Is it possible to integrate syncthing on a server with nextcloud on another server?
Yes, try googling setup instructions for details on getting that going.
Note, doing this means those directories will no longer be synced by Nextcloid. They will only be accessible through nextcloud as-is. For this reason it is not often recommended.