Another example of how almost any cell contributes to immunity is that depending on the way a cell dies (apoptosis vs pyroptosis vs necroptosis), it can release its contents, including nuclear proteins, and other "Damage-associated molecular patterns" which act as an inflammatory recruiter of other immune cells.
https://en.wikipedia.org/wiki/Damage-associated_molecular_pa...
For pyroptosis this includes endothelial cells, epithelial cells, neurons, heart muscle cells, liver cells, fibroblasts, and pancreatic β-cells.
On top of this, there are several ways that "non-immune" cells are constantly doing internal immune tasks, or performing 'citizens arrests' if you will, including: restriction factors, cellular stress response, autophagy, and viral RNA/DNA detection. For example, many "non-immune" cells express Toll-like receptors which are used to detect "Pathogen-associated molecular patterns".
https://en.wikipedia.org/wiki/Pathogen-associated_molecular_...