How to create manually create my own ᴏᴛᴀ update file to be used for adb sideload? In my case, I don’t want to permanently root my own device and if possible, I want to modify the /data partition directly.

In order to do so, I want to add a single file to the /system partition or even apply capabilities on a single executable. That means no apk ; no new apps ; no bootloader changes.

But everything I found for creating my own ota for rooting explains how to use adb to apply it, not how to build such a file myself. Or suppose that I’m building for a firmware I designed myself for which I have the signing keys (whereas the aim is to do it for stock Samsung).

So how to create my own file‑based (with the aim to modify file permissions to existing files) ota zip file which can be installed through adb sideload on all devices as SuperSu does ?
You can't create or modify OTA zip without the proper OEM signing key. However, there exist holes in older devices like Samsung Galaxy Y which allow flashing unofficial zip with test keys, but these kind of hacks are outdated (source)  

if you want to create OTA zip you need update-binary for your device and write updater-script in EDIFY language  

you can also replace update-binary with shell script which makes things easier and device independent  

learn how to sign your zip (scroll down to Zip Signing)