I want to know if you can directly connect to an iPhone on a 3G connection using a TCP socket, or if there will be NAT problems.
In addition, will sending data over a socket be transparent to me as the programmer whether the user is using wifi or 3g?
Yes, unless you explicitly check, you will never know the difference. However, it's obviously good practice to either warn the user or use less data if on cellular, because you don't want to eat all of their data.