Not really, though it depends on what you're doing. If you're playing an offline game with no internet connection then that's the safest way to do it, but if you want zero chance of getting banned then don't use Cheat Engine (or any hacks).
If you change executable instructions then it's very unsafe. If you change your minerals in a game with other real players then the game will desync and end.
Changing minerals in a single-player game has historically been safe, but the local player's minerals are mirrored in several memory locations so there's no guarantee that Blizz doesn't compare those values from time to time.
You can also read through the SC2 coding forum here if you want to learn more about finding memory values and such.