If you need to send raw bytes over Wi-Fi (not HTTP), most cross-platform frameworks won’t give you this out of the box. NativeScript can do it, but you’ll need to create a small native plugin and call your Java/Kotlin (Android) and Swift/Obj-C (iOS) code from JavaScript.
So yes, it’s technically possible in NativeScript, but if low-level Wi-Fi communication is a core part of your app, then fully native iOS and Android development might be the simpler and more reliable option.