Make sure Gatekeeper is enabled.
Open System Preferences > Security & Privacy then select the General tab.
Make sure either Mac App Store or Mac App Store and identified developers is selected. If that area is grayed out, click the padlock icon to proceed.
If you have Little Snitch installed, that can prevent access to websites.