Nope, stern means being firm, harsh, unforgiving, or suggestive of those traits. Like he's a good teacher, but he's quite stern with his pupils. It doesn't connote nastiness particularly, but it does connote fairness. It could be a good quality.
If someone (or more often, something) is grim, it means it has a desolate or foreboding atmosphere. A grim person will probably not be very jolly or smiley, and thus similar to a stern person in that way, but other than that they mean rather different things. If someone uses a grim tone of voice, they are usually expressing their sympathy for the difficult circumstances that are about to befall one or other of the speakers, or someone they are talking about.
I would say that 'stern' and 'grim' are only interchangeable to a certain extent. 'Stern' is usually used to describe a person who has a particularly strict manner about them or to describe a very strict set of guidelines or rules. (Example: The boy's father is quite stern and forces the children to finish their chores before dinner.)
'Grim' usually implies a thing or situation that is grotesque or sometimes foreboding. (Example: The sight of my friend being stabbed by a burglar was very grim.)