Short answer, yes.
Longer answer: yes, but....
Different chargers have different outputs. The M8 charger is probably a 2 amp output. The charger for your EVO (I'm making another guess here) is probably a 1 amp output. (for reference, the USB port on a desktop PC is very close to 0.5 amps). So, it will charge just fine, but not as fast as the factory charger. If you're in a pinch you can also just charge it off your PC. (Some laptops don't charge properly from USB ports unless it's turned on and running. Some won't charge while in "sleep" mode).
It will work, and it won't damage or hurt anything.