This is a pretty complicated question with a complicated answer and it will depend on the specific facts involved in your circumstances. I would recommend that you sit down with a real estate attorney in your area who has foreclosure experience and discuss your situation.
The short answer- yes, you could get your home back even after a foreclosure sale has occurred. However, given that you are dealing with modifications, my best guess is that you would be unlikely to get your home back. You may have a colorable claim under HAMP, but that is a difficult proposition, particularly in light of some of the federal case law on the issue that I've come across from California. It's difficult to give more advice on the issue without a chance to discuss your situation with you and review the documents you've received. Many attorneys offer free consultations and should be able to give you a more in-depth answer than what you'll typically receive through AVVO.
It's not clear whether the foreclosure has actually taken place or not. I agree with Attorney Wang that this is a complicated question which requires much more information and analysis. However, to give you a brief response, the answer is YES, there have been instances in which a foreclosed upon owner was able to sue and win for wrongful foreclosure in California.