Using a Gamepad To Control Any iOS Device?
It's definitely possible to use a PS3 controller on a jailbroken iPhone. You need the $7 app Blutrol and the SixpairTool for MacOS X. Before I rewrite the instructions, please simply refer to http://lifehacker.com/5991266/how-to-use-a-gamepad-for-any-ios-game-not-just-emulators.

EDIT: In a nutshell

GETTING READY:

First, you need an jailbreak your iOS device. Then, download the App Blutrol (http://apt.thebigboss.org/mobileweb/onepackage.php?bundleid=ch.ringwald.blutrol&amp;db=), which currently costs $6.99. In order to use the PS3 controller, you will need an additional app for MacOS: SixPairMac (ringwald.ch/cydia/blutrol/SixPairMac-v1.0.zip)

SETUP for PS3 controllers:
Connect the PS3 controller via USB Cable, and the iOS device (via lightning cable or 30-pin cable) to your Mac. Click the button "Pair Controller to iPad" in SixPairMac. Now, open Blutrol on your iOS device and select the PS3 controller.