Yes, range finders are legal in golf. There are many different types and brands of range finders, but they all work essentially the same way. They emit a laser beam that reflects off objects and back to the device, which then calculates the distance to the object. This information can be used to help choose the right club for your shot.
There are some restrictions on how you can use a range finder in competition. For instance, you can't use one to gauge wind speed or direction, or to measure elevation changes. And while you're allowed to use a range finder during practice rounds, you can only consult it between shots (not while your ball is in motion). But as long as you stick to these guidelines, using a range finder is perfectly legal and can give you a big advantage over your competitors.