The exclamation mark cancels the currently running command. It’s like tapping escape.
If you were in the Line command being prompted for points and you clicked an icon that ran “Circle”, Rhino would not accept “Circle” as valid input for the Line command.
The apostrophe can be used if the command you want to run can be run “transparently”. A good example is a view change command like Zoom. If you’re in the Line command and you need to Zoom in, if your button macro starts with an apostrophe, you can click it, zoom in, and resume the line without interrupting it.
The leading underscore ensures your macro will work even if it is used in a localized language. Since Rhino is developed in English, it is always there. Without the underscore, your macro would only work in the localized language the command name belongs to.
There are other macro commands too like “Pause” so your macro can stop for user input like selecting a point or entering a value.
@wim is right. Look in the Help file for the details.