Yes, in the firewall settings, you should allow for incoming connections for the Mirror to TV applications. To make this change, go to System Preferences:

 

screen-shot-2016-10-27-at-15-55-12

 

Then select Security & Privacy, click on Firewall and click on the lock to make changes and select Firewall Options:

 

screen-shot-2016-10-27-at-16-41-47

 

Do not select “Block all incoming connections”, because if you do this, your TV cannot reach your Mac to start screen mirroring. Next to the Mirror to TV app, “allow incoming connections” should be selected.