Short answer is NO, you can't get an AT&T iPhone and then hook it up to Sprint. Sprint's network technology is CDMA and the iPhone is GSM. There are rumors that a CDMA iPhone will come out, but for now the two technologies are incompatible. There's no amount of hackery that will make a GSM-only phone work on a CDMA-only network.
Now, if Sprint has GSM out there (I'm not sure, but I don't think they do), you have two choices:
Get an AT&T iPhone (used or new) and then hack it. If you're not really into hacking on phones (even though the programs make it pretty straightforward), this is not for you. Plus, it's against the terms of service and Apple and AT&T are both actively working against you. They will try very hard to undo your hack through software updates and such.
The legal way (again, only if Sprint has GSM, which I don't think they do) is to buy an unlocked iPhone on eBay. They come from places like the UK and Hong Kong where, for various reasons, Apple is required to allow them to be unlocked legally. They go for hundreds more than the straight price you see at AT&T, though. They're very expensive.