Yes banks can still foreclose on your mortgage even if you make partial mortgage payments.
Making partial mortgage payments is better than making no payments to the mortgage at all but a bank can actually refuse that partial mortgage payment since you're deviating away from your original agreement to pay the full mortgage payments on time.
If you're having trouble paying the monthly mortgage payment maybe take out another loan such as a payday loan to help with the mortgage payment and contact the bank and let the bank know what's going on.
Partial mortgage payments can also hurt your credit score because the bank can report your mortgage payments as late.
Having a bad credit score can hurt your chances of renting a home or buying another home should you be foreclosed on and have to move out of your home.