They can, but in practice, they usually don’t. Here’s why: in order to foreclose, the second lienholder has to pay off the first lienholder. Usually, a second lien is small in comparison to the first. Also, the amount of a second and first mortgage combined is often very close to the value of a property. Thus, there is often very little equity to cover foreclosure expenses, making the foreclosure economically unfeasible. This illustrates how second mortgages represent a higher risk to lenders, thus resulting in higher rates for those types of loans.
On the other hand, if there is a great deal of equity left, it may make sense for a second lienholder to foreclose. In “real-life,” however, that is seldom the case.