I didn't get any with my first two, but I did get one a few days after my third was born. Didn't happen right away, which seemed odd to me. I honestly don't know if there's a way to prevent them, but I think what Amy said is bound to help - don't push unnecessarily hard, if you can help it. But, that baby's got to get out one way or another - don't hold back if you need to push, just to avoid hemorrhoids! I think that avoiding straining in the days right after birth is important too. Keep up your fibre and fluids.
If you get them.... get attention for them ASAP! I left mine for a while, hoping they'd go away, and they HURT SO BADLY! Mine was external, which is the nasty kind, I guess. Anyways, the midwife prescribed proctofoam which has a pain reliever, as well as something to help heal the hemmorhoid, and it was wonderful! If you end up needing it, see if you can get that stuff.
Bookmarks