It actually works quite the opposite. You will be way better off financially moving from the SF/Seattle/NYC than to. The wage adjustments just don't come near handling the extra expenses.
However, if the choice is between working for a local company and working for a high end bay area firm, then absolutely the best financial move is to move to SF/Seattle/NYC. Local companies here top out at $150,000 for a senior engineer, so if I can make $400,000 in a big city, then even with the higher cost of living, I still would come out way ahead living in SF.
I could go on, but you get the point I'm trying to make here right?