as per USGA
Rule 16Requirements for Hole Location on the Putting GreenQ. What are the requirements for establishing a hole location on the putting green?
A. The USGA frequently receives requests for guidelines with respect to selection of hole locations on the putting greens, particularly during competitions. There are no rules regarding hole locations, so there is no such thing as an "illegal" hole location. The USGA believes that many factors affect selection of hole locations. The first and most important is good judgment in deciding what will give fair results. Do not be tricky in locating holes. Following are specific points: