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 that has a different region than the one the drive is set to, you get the dialog above. If you click cancel at this point, the DVD is ejected, so have to Cntl+Click on the DVD Player icon, hold down the Option/Alt key and 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, and click OK (usually this is selected by default). The DVD will now play, and your region code will remain intact.