When playing Foursomes golf as both partners compete as one side playing only one ball either partner may take any action that is allowed before a stroke is made such as to mark the spot of the ball, lift and replace it and drop and place a ball no matter which partner’s turn it is to play next for the side.
Penalty strokes do not affect the order of play. Have a look at Rule 22 which covers all the rules to do with Foursomes (Also known as Alternate Shot)
In playing Four-Ball golf a player may likewise take any action concerning the partner’s ball that the partner is allowed to take before making a stroke, see Rule 23.5a
In both Foursomes and Four-ball a player must not stand on or close to an extension of the line of play behind the ball while their partner is making a stroke to gain information for their (the player’s) next stroke. Rules 22.6 and 23.8
Finally please use your putter head to lower the flagstick to the ground after removing it from the hole to avoid unnecessary damage to our greens by dropping the flagstick on it.