The putting green is one of the five defined areas of the course. It is an area specifically prepared for putting, which means you have some special permissions here, including the ability to mark, lift and clean your ball any time. To mark and lift your ball, you must use a ball-marker, which is an artificial object like a coin or tee. You are also permitted to repair most damage (other than natural wear) on the putting green, including spike marks, and remove sand and loose soil – even when your ball is off the putting green.
Once you have marked, lifted, and replaced your ball on the putting green, your ball owns that spot. So if it moves for any reason, you will replace it without penalty. If you have not marked, lifted, and replaced your ball, whether you replace it or play it from its new location depends on the cause of the movement. If you or anyone else accidentally causes your ball to move, replace it. If wind or another natural force causes it to move, play it from its new location. There is no penalty in either case.
On the putting green, the flagstick indicates where the hole is located. You are allowed to putt with the flagstick in the hole, and there is no penalty if your ball strikes the flagstick. If the flagstick is attended or removed while you make your stroke, it can be moved out of the way while your ball is in motion. Otherwise, it must be left in position from the time you make your stroke until your ball comes to rest.
The Committee decides the hole location and, while there is guidance, there is no such thing as an illegal hole location.