Is it possible to block visitors from an ip or country

Is it possible through Matomo to block ip addresses or create a blacklist instead of using the .htaccess for this function?

Matomo logs and collects data. It does not change the behavior of your site. So no, and it is outside the scope of the system as far as I know.