The foundation is probably the most important element in any building. While it’s possible to fix a foundation, it takes time and money.
More importantly, a house with foundation issues isn’t going to pass the inspection process and may jeopardize your mortgage loan. If you really like the house, hire a structural engineer to examine it. Otherwise, keep looking for a home.