In American English, the semantic difference is huge! An "eraser" is what you often see on one end of a pencil, and a "rubber" is a condom. So, when you're in the United States, use "eraser." Otherwise, you might get some shocked looks or loud laughs in the classroom. In British English, they use "rubber" for an eraser.