I guess that is possible if you try to do so -- compile your own stuff, or download and run it. But if you act normally instead, installing just what you actually need, from the package repository (where most things are "pledged" and "unveiled" which adds some impressive protections), I think the chances are much lower than with other OSes.
Also I separate things by user account, so I don't do my general browsing as the same user that does my programming, which is again separate from bank access, which is separate from .... So the kernel is providing a lot of protections.
(And I usually browse without images and javascript, which is not OS-specific but a suggestion. Many things I use don't require it, and I can flip it on or configure it specifically for those that do.)
Also I separate things by user account, so I don't do my general browsing as the same user that does my programming, which is again separate from bank access, which is separate from .... So the kernel is providing a lot of protections.
(And I usually browse without images and javascript, which is not OS-specific but a suggestion. Many things I use don't require it, and I can flip it on or configure it specifically for those that do.)