If you think of exploits using Office documents (LibreOffice got some problems there too, not only MS Office) then just taking some generic firewall will very likely not help you.
What you would need is a firewall which works at the application level and not just transport layer (i.e. IP address and port), is able to extract the documents from all relevant sources for analysis (i.e. web, mail, maybe FTP, maybe encrypted traffic) and will also be able to do a proper analysis of LibreOffice documents for problems specific to LibreOffice. At least none of the simpler firewalls like builtin into Windows or available in typical home routers will do this. Some enterprise-grade firewalls (called NGFW, UTM, Secure Gateway or similar) might claim to be able to this and probably can do most of it, but they are not foolproof either. A firewall should only be one line of defense and not the only line.