1. Yes it is possible to communicate from a web window to the parent Lectora page.
2. Yes it is possible to use JS in your web window to alter a Lectora variable.
3. Depending on whether the contents of your web window is hosted with the course or remotely, communication approach will vary. Locally hosted content can directly access parent window variables. Remote content will not be able to do so. You will have to set up communication using postMessages. In short, the web content will send postmessages to parent Lectora page, and a local script in the parent page will catch those messages and act on them, e.g. change Lectora variables. Generally speaking, the latter is the “correct” way of doing this even if your web window content is not hosted remotely.