Ubud in general is a very safe town, with low crime rate and close to no complaints on safety from tourists. As a town heavily reliant on tourism the Indonesian authorities have done a good job to keep the crime rate very low.
It is safe to walk around Ubud at night alone but it is always good to walk with a buddy or guide - especially in the outer parts of the centre where street lights are limited.
To avoid being stopped by the police (and potentially fined) try make sure you wear a helmet when riding a scooter/motorbike.
When hiking or biking in the woods it is always recommended to go with a guide to avoid getting lost (rather than safety). As with Bali in general, Ubud is very safe so just smile and enjoy your visit!