You will find the official documentation about WP 7.1 and WP 8 platform compatibility in the following link:
App platform compatibility for Windows Phone
Although in general any WP7 app will run without problem in a WP 8 device, this documentation addresses some cases where the behavior may be different.
So, if you don't use any specific features introduced in WP 8, you can develop targetting WP 7.1. That way your app will be available for more people. If you want to take advantage of WP 8 specific features such as NFC or Nokia maps, I would recommend to develop for both platforms, reusing as much code as you can.