There is absolutely no problem. If you can compile and run a program on Windows 95, that same program should run on Windows 98, ME, 2000, XP, Vista, 7 and 8. But you'll probably need an old development environement such as Visual Studio 6.
But if you are writing a program that should run on Win 95, you cannot use the APIs that have been introduced after Windows 95.
But honestly today there are not many reasons why Windows 95 should be supported.
Seel also here.