Is mechanical energy conserved when you change the surface of motion?
Yes, of course. That pesky second law of thermodynamics, it really doesnt care what we want it to do. Both examples provided have one form of energy transmitted to another. When a ball accelerates down a hill, it is changing its gravitational potential energy to kinetic energy. When it reaches the bottom, it will just continue to roll until acted on by an outside force, most likely some form of friction. A projectile (bullet for ease) will impact the ground and continue moving only if it has the energy required to overcome what is required to deform the object it struct. If its materials give way first, it will mushroom. If the other gives way first, it will penetrate. If it strikes an object at an angle, it will ricochet, having imparted some of its velocity into the surface, which transmits it back in order to change the bullets original momentum to a new vector. In either case most of the energy will probably be consumed as heat, or changed to a new vector. In a rare case this may actually be an unbalanced force on one part of the bullet, which sets it spinning. That is really cool, I would say look it up if you get a chance. No matter what, energy is always conserved, and it always, always goes down in gradient. Energy really does get more distributed in the universe. Entropy wins. If you want to push a local objects entropy back, you have to take the energy needed for that from somewhere, resulting in a net loss.