Distance measuring devices such as rangefinders are designed to provide distances to the flag or specific hazards. However, there is no rule in golf to prevent you from using a rangefinder on the green but you are unlikely to gain any benefit from that.