So yes, it is possible, like everything in software development. Here are my thoughts/ideas.
If your serialized data is very small or just a number, then you could also just use Barcodes, with for example https://github.com/lindell/JsBarcode and https://serratus.github.io/quaggaJS/.
If your serialized data needs to be more flexible or in a custom object and does not exceed 3 KB (or the limits mentioned here) than you best go with QR-codes.
You would of course on the receiving part of the application need a reader like for example:
And if you have a lot of data or need real-time-communication between two clients (e. g. Video/File-Transfer/etc.), then currently (as far as I know) you would use WebRTC. For this case you might need a TURN-server in between to establish the direct socket-connection - in this case I advise to take a look at SnapDrop which does it like this.
Good luck and let us know what you ended up using!