So you want to take arbitrary code in arbitrary languages, and run it on someone else's computer inside a sandbox?
Yes, wasm can do that.
You can compile the code to wasm, then run it in a runtime like wasmer or wasmtime. Or you can ahead-of-time compile it with something like wasm2c, which generates C code.
w2c2 is also very good