Why develop? Every region has a specified IP range. One can use existing softwares to block a given range.
Even if you want to develop, 'yes' it is somewhat possible to block a country. Read about
IP Address[
^] here. How they are defined and what can be your plan/logic to handle it.