Copied from the Tech Specs for the iPhone 3G.
http://support.apple.com/kb/SP495
+Video formats supported: H.264 video, up to 1.5 Mbps, 640 by 480 pixels, 30 frames per second, Low-Complexity version of the H.264 Baseline Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; H.264 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Baseline Profile up to Level 3.0 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats.+
Depending on where a video originated, it the video can be imported into iTunes and can be played with iTunes, iTunes includes an option to covert a video to iPod/iPhone format. With the video selected, at the iTunes menu bar go to Advanced and select Convert Selection for iPod/iPhone.
If this doesn't work as intended - with some content converted this way the video is available but not the sound, there are some ripping utilities available that include a preset for an iPod and/or iPhone.