It's really a matter of how you define "platform".
E.g. .NET is platform independent as long as the platform is .NET, the same way that Java is platform independent as long as the platform is Java. That is to say, .NET (and Java) are, in part, platforms in themselves (CLR, JVM). As long as there is an implementation of that platform available for a given physical platform, yes, you can run the compiled code on it independently.
In the end, "platform independence" is, just as
"write once, run anywhere"
, marketing. But in practice, currently, there are JVM implementations available for a lot more concrete platforms than .NET (although initiatives such as the Mono projects aims to change that).
Also check some similar discussions:
Is .Net platform independent?[
^]
Is .Net Platform independent or not ?[
^]
Is .Net Platform independent ?[
^]
Is .NET platform independent?[
^]