This is a fairly old post but just ran into the same issue today...
I managed to find a "nicer" solution to the linux headers problem but still ultimately could not get the backup agent working because the synosnap package is too old to run on modern proxmox I think.
Anyways for those who care, I used this thread as guide:
https://community.synology.com/enu/forum/1/post/152443
I put the files in /home and ran: ./install.run --target ./tmp
This failed but now I had the individual setup stuff in /home/tmp/ directory.
I went to that new directory and opened ./install.sh with nano, goto the very end of the file and then a little up:
Change the word Linux to pve and save, now it wont look for Linux-headers but pve-headers and the install will proceed normally
View attachment 71374
However, even after all this synosnap does not install because it wants a old 5.15 kernel or something like that and gives dkms errors.
When i force install it with: dpkg --ignore-depends=dkms -i synosnap.deb
it installs with a some depreciated stuff warnings and then ultimately does not work and I just uninstalled everything
Hopefully at least this kinda helps someone in the future.