Short answer: yes.
A stream in the context of software is simply a sequence of bytes. What those bytes represent is up to you: it could be ASCII text, Unicode characters, a JPEG image, serialized object, anything your heart desires. The important thing is that the producer and consumer of the stream agree on the format.
Furthermore, a stream is not specific to two programs talking to each other. You can use streams inside the same program so two modules can talk to each other in a loosely coupled way.
What you are really looking for is the idea of sockets. A socket is typically used for IPC, or inter-process communication. A high level overview of the process looks like this:
- Program A opens a socket to a specific location, normally an IP address and port.
- Program B is listening on that IP address and port, and opens the socket on the other end.
- Both programs open streams for that socket. Program A can write bytes to its output stream, which show up in Program B's input stream after crossing over the socket. The reverse is also true, allowing bidirectional communication.
- When communication is done, one side closes the socket connection.
(If you think about it, this sounds a lot like loading a web page in your browser. This is not coincidental.)
Note that the language, architecture, and physical location of the two programs are not specified. That is the beauty of sockets: they are very low level and simply do not care about those details.
Normally you will use a library to deal with sockets and streams. Some languages have such facilities built-in to the standard libraries, some do not. Regardless, most popular languages will have something available because this is a very common task asked of modern computer systems.