In the absence of any firewall restrictions on the local machine, any applications running on the machine may listen for incoming communications or send outgoing communications.
There are some in-built limitations for this - for example only software running as "root" may listen on port numbers below 1024. But by and large, any application may send data or receive it.
This is fine if all the software on your machine is trusted, but if you should happen to have any malware running on the machine, or any software that has vulnerabilities, its unfettered access to incoming and outgoing communication could be a problem.
On a typical home network connection, your home will have a router that has sensible firewall rules. For example, it will typically have rules that will deny any incoming connection from the internet that is not part of a communication that was established from inside the network. Indeed, IPv4 communication will usually be using NAT where this is mandatory. It may also block all communication on port 25 (crucial for spam bots to send spam email, but not needed for regular users to submit email to their email server) and perhaps some other ports that should never be expected to be used in a home network.
On a typical corporate internet connection the same will be true plus the administrator of the corporate network may have established additional rules.
Such rules help to protect the machines inside the network from much of the types of attack concerned, including attempts from outside attackers to exploit vulnerable software on the inside, as well as the ability for malware within the local network to receive any kind of remote-initiated communications. When it comes to attacks from inside the network, however, that firewall on the boundary is not relevant. If a computer inside the network is compromised, it could conceivably launch attacks throughout the internal network.
This can be mitigated somewhat by other approaches such as monitoring the software loaded onto computers and running virus scanners, and corporate networks tend to do this, in addition to most home users having included virus protection.
A firewall on a local PC can help add just a little more more protection against some kinds of malware, particularly in environments where you have a large number of users on a PC or a large number of people on the same local network.
For example, should you set up the firewall on the local machine to block incoming data that is not part of communications initiated from the local PC itself, a tactic similar to routers at the edge of local networks, you gain that little bit of added protection against attempted network attacks launched from within the local network.
When configuring such a firewall, you will need to add any exceptions for services on ports which need to be able to listen for incoming communication initiated from the outside. Though, you will need to do the same thing at the network router too.