I want to paint a second hand bmx bike i just bought cause it needs it and i know what to do but i have an electric sander and i figured it could save time then just using regular old sand paper, ive only used it on wood so i wouldnt know is it safe?
Well, assuming you know how to properly operate the sander and how to anchor the object, then yes, it's "safe".
Is it a good idea? Not as much. It's easy to create textures, and surface inconsistencies with an electric sander. Sounds like you wont care so much about that though, so you may as well just go for it.
Just be sure to pay close attention and don't let the sander linger over the welded joints and stuff like that. Don't want the frame strength compromised.