Is it possible to program an iOS app using an iPad?
Yes and no, but mainly no. Let me explain.

You can't use an iPad (at least not yet) to go through the entire process (i.e. design, test, and submit your app). You also can't use Xcode on an iPad (at least not directly, although you could do this remotely - but that is not a practical solution).

People can and do use iPads for:


learning how to code
editing code using various editors (but not Xcode)
designing some of the other resources/assets used in apps (e.g. images, icons, sounds, etc)


However, most development is done using an integrated development environment (IDE) such as Xcode. Most apps for iOS (and macOS, tvOS, and watchOS) are programmed and submitted via Xcode, although there are alternatives.