Thanks to a stupid law, every DVD player (that includes the one in your computer) is sold being able to play only discs with the same region as the country it was sold in. That includes Macs too, sort of. On a new Mac, the DVD drive is automatically locked to the region code of the first DVD it is used with. From then on, this can only be changed four more times.
You pretty much have two choices — either find the region code that you'll be using the most and set it to that one (since the four times are going to be used up sooner or later) — or "flash" your drive to the region free, which goes with the risk of destroying the drive.
When you insert a DVD with a different region with the one of your drive, you get the dialog above. If you click cancel at this point, the DVD will be ejected, so Cntl + Click on the DVD Player icon, hold down the Option/Alt key and then click Force Quit (you can set DVD player not to open when a DVD is inserted in System Preferences).
Download and install VLC and open it, then select File > Open Disc.
Click on the Disc tab -> click on DVD -> select the device -> click OK (usually this is selected by default). The DVD will now play, and your region code will remain intact.