Yes, but when they do it on a campaign trail after touting the opposite view for decades, it's called flip-flopping, and is really scummy. I do not trust candidates who will flip-flop on the campaign trail, pandering for votes.
My thought is that Rudy may change on immigration after he actually has responsibility for it, as president.
Romney does seem to have a better position. But he has a record of flip-flopping.