well it depends upon the construction of motor or generator,
if generator is self excited then its possible to convert it into motor and vice versa.
other wise if it is excited from external source then it is not possible my friend
and yes braking can be applied, if the rotation if motor is changed
all physics