It depends if its regulated or non regulated.
So most residential mortgages (eg one you take for your own house to live in) are regulated and yes they cannot withdraw those unless there are certain circumstances, one good example of lenders share information and have fraud systems, such an Hunter, CIFAS, SIRA etc - if a lender offered on a regulated mortgage then found out through one of these systems the guy or lass was a naughty boy they have the right to pull it.
BTL mortgages are generally unregulated, and therefore can be pulled, however that obviously risks reputational damange so lenders generally wont, and is a sign of desperation if they do.