Are there countries where not all plane crashes are investigated (even if deadly)?
As of 2017 191 of the 193 countries are signed to the ICAO anex and there are 122 national aviation authorities so at least some countries lack serious formal aviation authority and often look to other nations for help. Smaller, war torn nations or nations that do not have the facilities of first world countries may simply not have any ability to provide SAR operations. Its not just about having a helicopter or two hanging around but having a trained crew, a flight doctor and a hospital to bring the potential survivors back to.     

Countries are under no obligation to provide SAR operations and generally speaking international treaties can't really force any country to offer something like that. In some cases the crash sites can be difficult to access or outside the range of practical rescue at the time of the incident. In these cases there may be incidents where a country simply cant investigate as it may risk the lives of those investigating. 

There are some notable exceptions, the FAA will provide aid to any investigation involving an American built aircraft or having Americans on board anywhere on the globe. This is of course assuming they are permitted to provide such aid (which may not always be the case). The FAA also has a lot of tooling for recovering black box data and in many cases foreign investigations will send the black box to the FAA facility if they lack the data reading tools. 

Its not always known when or where planes crash. This generally applies to smaller aircraft that fly VFR from uncontrolled fields. Broadly speaking its possibly to not tell anyone you are going flying, depart at night, and crash in a remote area unknown to anyone that you were ever up or what your flight path was. In this case its possible no searching is done if no one even knows the aircraft needs to be located.