Can I use Acera m4000 on trails without damaging anything on my bike specially my derailleur
Acera is considered to be the entry level MTB groupset. It will be fine off road riding within limitations.
More expensive group sets tend to be lighter weight, with more refinement - things like bearings in stead of bushing, seals to keep dirt out etc. As such the more expensive groupsets are more durable (to a point where the race focused stuff saves weight to sacrifice durability)
The main problem you will face is the components will wear out quicker than if they were higher quality, however if you wear them out, its a sign your riding enough to justify spending the coin on higher quality.
The other problem you may face is that it will become trickier to tune as it wears out and may ot stay tuned as long as better quality components. This can cause breakages if poorly tuned and poor riding techniques combine att he wrong time time (e.g. power while shifting). You may need to tune the bike up a bit more often.
Shimano components bearing M4000 are actually named Alivo and are a step up from the Acera groupset, the newest models of which bear M3000. Both groupsets are designed and marketed for more casual or entry-level mountain bike set. One will find these on the less expensive offerings of a bike shop. The quality is very high, however, when comparing same level components offered on the market. Shimano has been known for passing down designs and technologies of their upper-tier groupsets to the lesser ones so the new models are comparable in performance to the upper tier models of 2-3 generations ago (that's in terms of bike component generations as opposed to human lifetimes). This is demonstrated in the "Shadow" design of both the new Acera and Alivo (M3000 & M4000) rear derailleurs. First seen on the top-dog, XTR mountain group, it's now offered at this level. The Shadow design tucks the rear derailleur more behind the drop out making it more protected from falls and contact with objects one may encounter on a trail ride. I really like the sleek look of these mechs too. Especially the Alivo.
If your set-up is solid---limit screws properly set so it doesn't end up in the spokes, paired with a compatible shifter and shifting indexed-- you should experience excellent performance on road and trail with either model.