To summarize the answer
- Windows Phone 7.x apps can run on Windows Phone 7.x & 8.0 (reverse not possible)
- Windows Phone apps can't run on Windows 8
- Current desktop apps can run on Windows 8 (not Windows 8 RT)
- Current Windows 8 (or Store) apps can run on any Windows 8 device
If you want to build an app which should run on all devices i.e. Windows Phone 7.x and above, Windows desktop, Windows 8 etc... You can separate the user interface part and business logic. There is something called as Portable Class Libraries. You can use them to share the code between apps.
For more information: http://mayurtendulkar.com/2013/09/cross-platform-hybrid-or-native/ http://msdn.microsoft.com/en-us/library/vstudio/gg597391(v=vs.100).aspx
Hope it helps.