I know that Android apps are developed in Java because running all applications in a virtual machine grants less compatibility issues. IOS instead uses objective-C because it is developed to run just on few devises (IPhones series). How can the ubuntu touch apps be cross compatible being developed in C++? Is there a compatibility level which cannot be crossed or anything similar?
It depends on the kind of app being developed.
If you use the Ubuntu SDK and QML, your app isn't compiled but instead is interpreted by the Qt runtime. This means that your app will be able to run anywhere that Qt5 is available. And since it's not compiled, you don't need to worry about the physical device's CPU Architecture at all.
Because Ubuntu is the base system for all of these devices, and because of work that has gone into projects like Linaro, we can offer apps the same runtime environment across multiple ARM devices, which means you don't need to compile C++ apps for specific devices, just for Ubuntu. If you have clean C++ code, you can compile the same source for arm, x86 and x86_64.
Ubuntu Phone apps (except HTML5 apps) are developed using the Qt toolkit and the Ubuntu SDK. As a result, they are easily portable to other platforms (where Qt is supported).