If you have test kits check your water to be safe. If nothing is out of the ordinary observe your fish's behaviour once more. Is it one fish 'scratching' or is it more? Some fish naturally do appear to scratch themselves on rocks, its not exactly common.
Alarm bells shouldnt be ringing right away, perhaps do a water change a little more frequently, perhaps 10-20% twice a week. As you said in your post 'occasionally' is no great worry i would have thought. Occasionally i see my fish rub up against a rock, not often though.
If it becomes more frequent and/or you notice areas of skin/scales that appear to be sore or white spots appear on your livestocks body then you have an issue.
Bookmarks