I had a job offer from a company one time that wanted me to provide last year's tax returns. They said it was to make sure I wasn't "lying" about my previous salary. I had refused to answer the question so I couldn't have "lied". I did not take the position because a better one opened up but I noticed that they had the position open for quite a few months. I was glad because it made me mad they even asked it.
Most companies will ask, but it's not usually an issue if you don't answer. Or just lie. To me, when someone asks a question that's none of their business it's ok to either not answer or lie about it. You could ask them what they're paying people in similar positions. That's an equivalent question but I don't suggest that. They probably wouldn't like it too well :). Earlier in my career I answered with what I should be making rather than what I was. My entry level job significantly underpaid me and there was no reason to hop jobs 2-3 times to get to what I should have been making.