In RPG Maker..
The only 'MASK' you can set in base ruby is src_rect (which is part of the sprite class). It however, only allows you to set a viewable rectangle of the source sprite, which is how characters are already drawn. If you want to apply to image mask etc, then you must do it via GDI calls etc. If you are referring to any other sort of mask, can you please explain yourself better?
In Other.. This entirely depends on what engine you are using and what that engine has access to. For example: Express Game Maker has direct access to all MS XNA operations, so creation can be pretty easy. But with things like say Game Makers GML script engine, it does not provide access to outside resources (to my knowledge) and is therefor far more limited. So if there was not a method already available for you to do so, then you would be out of luck.
Best of luck with this!