Whenever I use the eraser on my tablet pen e.g. in sculpt mode, it enters a sketch session and erases my grease pencil work.
There are several options, depending on what you end up doing more often.
Option 1 - Disable the eraser keymapping: * Pros: If you're doing a lot of sculpting and using the eraser when doing that, and using the Grease Pencil eraser less in comparison, then this will be a good option. * Cons: You lose the ability to use the eraser to quickly erase GP strokes, and this is something you'll either have to save to your userprefs (or you're going to have to set it again on each session)
Option 2 - Lock the GP layers: * Pros: If you don't want the layers to be modified accidentally, just lock them. Then the eraser won't do anything to them. * Cons: It also means though that you can't easily draw quick new strokes on those layers anymore though. You'll have to remember to go in and unlock some layers to continue.