Any external drive which is otherwise compatible and can be properly formatted will work with Time Machine. See Time Machine Basics.
I would recommend acquiring a drive from a reputable retailer who offers a guarantee, and checking reviews from reputable sources like Macworld and CNET before buying.
I have a few Fantom Green drives Amazon.com: Fantom GreenDrive 1TB USB 2.0/eSATA Desktop External Hard Drive GD1000EU: Electronics and one LaCie Porsche Drive LaCie Porsche Design P'9220 1TB USB 3.0 Silver External Hard Drive 302000 - Newegg.com , all of which have been excellent.
I tried attaching the drive to my Airport Extreme and the Time machine backup was extremely slow. So I just hook them up to my macs when I want to make a backup.
Myself, I use a Time Capsule, which is similar to an external drive connected to an AirPort Extreme, except that the drive is internal to the Time Capsule.
In both these configurations, the communication would be over network (mine is Ethernet), which is slower than a direct connection such as USB, FireWire or Thunderbolt.
However, in my situation each hourly backup is realtively small, so doesn't take very long, so the slower network connection doesn't bother me. However, if someone is doing lots of editing of large files, a faster connection for TM backup might be desirable.
I have an older Airport Extreme base station and I would like to know if it is recommended to connect the external drive (that will be used with Time Machine) directly to my iMac or should I connect it to the Airport Extreme or does it not matter?
It matters a lot: