Bike helmets are specifically designed to protect the user from serious impacts. There are different kinds of bike helmets, including some that are specially designed for trail riding and mountain biking.
You don’t necessarily need to buy a super fancy MTB helmet, but you do want to make sure that it is a bike helmet that was tested according to U.S. Consumer Product Safety Commission Standards.