There is no rule on bunker rake placement and both are common. The USGA recommends placing rakes outside the bunker and parallel to the line of play, preferably along the outer edge of the bunker so that it will reduce the overall chance of it coming into play while eliminating its influence of a ball within a hazard. This is the protocol used for all USGA Championships.
From a maintenance perspective, placing rakes inside bunkers may be preferred for daily play because it makes mowing (and mobility of other equipment around bunkers) more efficient if rakes do not have to be picked up. If this is the case, place the rake on a flat portion of the bunker near the edge but not the back edge. This is to prevent a ball coming to rest against a rake on a steep slope within a hazard (see next paragraph). If mechanical rakes are used to prepare bunkers frequently, then placing rakes outside of bunkers may be beneficial if it speeds maintenance. In fact, some golf facilities do both and switch rake placement from outside to inside bunkers or vice versa depending on seasonal mowing requirements.
Regardless of bunker rake placement, if a ball comes to rest against a rake, and the ball moves once the rake (a movable obstruction) is removed, the Rules of Golf require that the ball be replaced (see Rule 24-1). This is fairly straightforward if the rake is outside the hazard but replacing a ball on a steep bunker slope is not always possible. If the ball won’t stay where it must be replaced (Rule 20-3d), or anywhere within the bunker not nearer the hole, the player may either drop the ball, under penalty of one stroke, outside the bunker (Rule 1-4; Equity) keeping the point where the ball lay directly between the hole and the spot in which the ball is dropped, or play under the stroke and distance option of the unplayable ball Rule (Rule 28) - see Decision 20-3d/2.
In all situations, select a low side (or sides if multiple rakes are needed for a large bunker) for placing bunker rakes. Climbing in and out of the high sides of bunkers causes major damage to the bunker face and the surrounding sod, so encourage players to enter and exit in low areas by placing rakes in these locations.