Not Really
The two most common alternatives to foreclosure are short sales, and deeds-in-lieu of foreclosure.
While these may be a better option for you from a financial perspective, they are all considered by FICO as “not paid as agreed” accounts, and are therefore are not better nor worse to your FICO.
Bankruptcy on the other hand is much worse to your FICO than foreclosure. While foreclosure is a single negative account, bankruptcy may involve many accounts and therefore has the potential to adversely affect your FICO much worse.