In the UK, this is covered in the Licensing Act 2003 (Mandatory Licensing Conditions) (Amendment) Order 2014, which amends the Licensing Act 2003 (Mandatory Licensing Conditions) Order 2010.
Mandatory Licensing Condition 2 states:
The responsible person must ensure that free potable water is provided on request to customers where it is reasonably ...
France is an often cited example of a country that mandates restaurants to serve tap water for free,
while Germany and Austria do not have any such legislation.
In Austria it is nevertheless more usual than in Germany for restaurants to not charge guests for tap water (according to the linked German newspaper articles).
In Germany, expect to be charged ...