For example
- 2 iPhones are running 2 different apps.
- 1 iPad and 1 iPhone are running the same app.
- 1 iPad and 1 iPhone are running 2 different app.
Does it has to be same devices running same apps?
I've never tried this. Hope someone can tell me.
The short answer is "Yes" for some scenarios described.
For your examples:
You should review the docs on GameKit for implementing a server/service and peering.