Can a website detect my local WIFI network I am in?

In theory, yes, the webrtc standard let's a website determine your local ip address, so it can create a direct connection for you to a another web-browser, allowing direct connections between browsers to set up video streaming for example.

This website has a proof of concept showing you your internal and external ip address: https://www.privacytools.io/webrtc.html

Once the website has both internal ip addresses, it can use javascript to try to set up a connection over the internal ip's from pc1 to pc2, if this succeeds, it knows these 2 pc's are in the same local network.

remark: Chrome on iOS, Internet Explorer and Safari do not implement WebRTC yet, see https://www.privacytools.io/#webrtc for more info.

Update 23/08/2018: Another possible attack vector has come to my attention lately:

DNS rebinding, from wikipedia:

In this attack, a malicious web page causes visitors to run a client-side script that attacks machines elsewhere on the network. In theory, the same-origin policy prevents this from happening: client-side scripts are only allowed to access content on the same host that served the script. Comparing domain names is an essential part of enforcing this policy, so DNS rebinding circumvents this protection by abusing the Domain Name System (DNS).

This attack can be used to breach a private network by causing the victim's web browser to access machines at private IP addresses and return the results to the attacker. It can also be employed to use the victim machine for spamming, distributed denial-of-service attacks or other malicious activities.

This works by having a malicious website/dns server setting a very low ttl for it's dns requests, and then having javascript running scripts on the original website's address. Half of the time the dns will respond with the correct external ip, so the website will load, but after a few minutes when the javascript kicks in and tries to access the website again the dns will respond with a local ip adres (e.g. 192.168.0.1, this can change every few minutes) and the browser will run the javascript and connect to devices on the local network!