Is this a standard phrase, or is there a rule for when to use в in contexts like these?

Is this a standard phrase, or is there a rule for when to use в in contexts like these?