OPlayer can play .avi files.
As to your other question, of how to download movies illegally, that question will not be answered on this forum.
Really? I'll answer him right now how he can download an .avi file. And on this forum no less.
The iPad does not have a torrent client that works for it, at least that I could find. The best way to accomplish this task, and believe me, Apple makes it a PITA for you, is to get a browser like iCabMobile, sign up for dropbox, buy Air Video and have a computer that is running. OK, now that you did all of that, here is the workflow of downloading a torrent.
Install Air video and set it up with the folder your torrent client is going to be downloading into. Sign up for and install dropbox on your machine. Go into your torrent client (I use uTorrent) and set it to "Automatically load torrents from" whatever your dropbox folder is with \iCab Mobile added at the end. Mine looks like:
"C:\Users\(whatever your username is)\Documents\My Dropbox\iCab Mobile"
Now that you have all that set up, on your ipad open up iCab Mobile and go to whatever torrent site it is that you are using. Download the torrent. Go to your downloads within iCab Mobile and select the torrent file and then select "Upload to Dropbox".
Essentially, what this is doing is downloading the .torrent file to your ipad, then uploading it into a folder on your computer that utorrent or whatever client you are using is watching for .torrent files. Then the client on your computer will start the torrent and it will download into the folder that Air video is watching. When its finished, you can use Air Video to play the movie back to your iPad.
Yea, I know, its ridiculously complex and annoying. Thats Apple for ya.