In case I'm writing a program (of any kind) in C, that is meant to be run on Linux environment, can I write it under OS X? (concurrency wise for example)
I'm asking this because I like programming in Xcode.
Sure, of course, since you can develop portable software that runs on both MacOS and Linux. Be sure to test it on Linux at regular intervals to make sure you haven't unintentionally added something unportable.
If you want to use Linux-specific features then you will have more of a hard time. Depending on what it is you do, the program may compile on MacOS but fail to work, or it may not compile at all. In that case, you can still "write" it on MacOS, but at that point you're just using MacOS as a text editor.