Accidentally moving windows using mouse
Currently, no, this isn't possible.

There's no such thing as maximising a window in OS X — I therefore presume you are referring to a window which has been stretched to fill the entire screen (as much as possible — i.e. not behind the menu bar). Since there is no difference between a window which has been enlarged and a 'maximised' window, there's no problem in dragging the window away from the menu bar, and it's not possible to prevent.

If you're always moving your windows, try something like BetterTouchTool. This lets you maximise any window by dragging it to the top of the screen.