Are apps device dependent? Are all Android apps device dependent ? Like for example if two different devices run the same version of Android can I interchange the app apk files ? Like the camera app ? Can I take the camera app of device A and install it in device B ?

Are the apps made by manufacturers or are they a part of the Android OS ? Like would it be possible for me to the get the Gallery apk of the Jellybean OS if I downloaded their SDK from Google ?
Not all apps are device dependent, but many are. One particular example is, indeed, the camera app, which is often dependent on OS revision, the actual hardware, and the framework the OEM is using (such as Touchwiz on a Samsung device). Many are reliant on the version of Android, although typically this only impacts using on an older version, up to a point.

As well, apps can be either developed separately or part of the system. Just depends on how the manufacturer wants to handle it. But they'll typically, these days, update them separately which then replaces the system app (really it just covers up the old version which remains), so the answer tends to be "a little of both." But if it's something made by the device manufacturer, they WILL lock it to their devices.

However your particular example, of the Gallery app from Jelly Bean, would probably at least partially function on a newer OS. That's based in AOSP, so not device-dependent. Only possible issue is whether it has any conflicts with newer apps on a newer OS.