It's a little more complicated than that, but yes. A program written in C/C++ can be compiled and linked for any OS/processor configuration there is a compiler/linker support for. What the program can do depends on what libraries are available on the platform it's built for.
In other words, you can't take a program built for Windows or Linux and run it on Android, you need to build it specifically for Android.
To do this, you use the
Android Native Development Kit[
^].