Yes , but , as a rule , a software firewall can be bypassed when a router cannot without directly logging into the hardware and assigning rules. a router stops most internet background noise such as port scans etc without hogging up CPU usage.
Programs that you install or that get installed cannot act as a server unless you open the port manually on your router , with only a software firewall software can easily bypass your firewall.