Too long for a comment:
Your question is quite unclear due to you mixing technical terms, concepts and jargon and not using them correctly.
Strictly speaking pfsense is not just/only a firewall, but by default combines the functionality of router and firewall with a web-based front-end and that base functionality can relatively easily be extended by installing additional packages.
pfSense itself can be highly available: install two pfSense nodes that act as an “active/passive” cluster with the primary node working as the master node and the secondary node in a backup role, taking over as needed if the primary node fails. Both the configuration and settings as well as state can be replicated from the master to the backup, ensuring seamless failover.
See: https://docs.netgate.com/pfsense/en/latest/highavailability/index.html
To provide high-availability and failover for your servers a typical solution is a load balancer and/or reverse-proxy.
pfSense can provide some forms of load balancing for your servers, typically by installing additional packages. The HAproxy package is a common choice.
Alternatively you can install HAproxy or similar software separately, rather than on your firewall/router appliance or get dedicated loadbalancer appliances.
A completely different method, that doesn't rely on an external load balancer or reverse proxy, is by for example joining your servers in a HA-cluster
As for your last question
I also like to know if pfSense or a other firewall can see which domain name is called and send for example s1.example.com to the first server and s2.example.com to the second server.
That can only be done with protocols to support including the hostname in the connection request (such as HTTP and HTTPS) as not all protocols support that. See:
How do I make protocol foo
hostname aware?
For protocols that do support that: HAproxy or similar software can be configured to use the hostname in the request for such redirection, as can many other (reverse) proxy servers