Preprocess variables only for certain blocks
Unfortunately, there is no way to do it like that (similar to hook_form_alter()).

The best way to do this would be to use $variables['block']->bid to apply modifications only to the blocks you want:

function mytheme_preprocess_block(&amp;$variables) {
  if ($variables['block']-&gt;bid === 'target_block_id') {
    // do something for this block
  } else if ($variables['block']-&gt;bid === 'other_target_block_id') {
    // do something else for this other block
  }
}