Lets say we have a network A with two webservers inside it, S1 and S2, both hosting a website on port 80. When a client from a different network is addressing A:80, which host inside network A, will receive the message?
Reading between the lines, you are asking about two servers on a private network using the same protocol port number and being contacted from the public network. That requires the NAPT (Network Address Port Translation) variant of NAT (Network Address Translation).
A limitation of NAPT is that you can only forward traffic for a particular protocol port to a single inside host, or use a round-robin method, but that will not let someone from the outside to choose the server.
Your example would require one of the inside servers to use a different protocol port. That is why businesses with multiple servers using the same protocol port get (buy) multiple public addresses.
This is possible, all you need is a Linux host running an open-source load-balancer running on it, eg. HAproxy/Ngnix, etc.
You can enable traffic to accept connections over port 80 on your Linux LB and share/load-balance traffic onto your internal server's ports can be 80 or any of your custom app ports.