Yes! If you move your ball accidentally while searching for it, it is a one stroke penalty and the ball much be replaced. This includes stepping on your ball which can easily happen when searching in the rough. You are also penalised if your caddie or partner in foursomes or four ball moves or steps on your ball so be careful when searching! The only exception to this rule is if you accidentally move the ball while searching in sand, typically in a bunker. In this case if the ball moves there is no penalty and the ball must be replaced.
The situation is the same for stroke play (including Stableford) and match play.
Rule 18-2 Ball at rest moved by Player, Partner, Caddie or equipment