Yes, you can block phone numbers used for robocalls and tech support scams, but that usually means having to take at least one call (or running the right software) before you realize something's fishy. And AT&T, at least, is trying to do better. In response to the FCC's request for tougher action, the carrier has introduced a free Call Protect service for HD Voice (voice over LTE) users that aims to block fraudulent and spam calls, in many cases before they even reach your phone. An automatic fraud blocking feature will stop scams at the network level, while you'll also get warnings about suspected spam calls if you're in an HD Voice coverage area.
You can activate the feature either through your account or a dedicated Call Protect app that also offers temporary blocking (up to 30 days) for known numbers. And yes, you can make sure that the automatic fraud screening doesn't inadvertently exclude your employer or a distant friend -- you can greenlight certain numbers to make sure they get through. While AT&T would ideally have Call Protect on by default, this optional approach may have to do so long as call filtering is less than bulletproof.