Exactly.
I’m not as familiar with the Nextcloud server codebase, but looking through it now it doesn’t appear to be so different. Both projects are written in PHP/HTML/JavaScript and have virtually identical server requirements. More recently Hubzilla also has made a significant shift to utilizing PHP classes. Translating code to implement features or protocols from one to the other is probably not a daunting task.