Unable to fetch alert rules. Is the Loki data source properly configured?

It depends what do you need:

1.) you need to remove error message
Just disable “Alerting” feature in your Loki datasource configuration

2.) you want to use Loki alerts (= alerts are stored in the Loki and not in the Grafana - I would say this is advance topic)
Investigate issue - there are topics about this type of issue on this forum