How can we get Block Bundle Type for block in code?
This is how I would do it:

use \Drupal\block_content\BlockContentInterface;


/**
 * Implements HOOK_preprocess_block().
 *
 * @param $variables
 */
function mymodule_preprocess_block(&amp;$variables) {
  $content = $variables['elements']['content'];
  if (isset($content['#block_content']) &amp;&amp; $content['#block_content'] instanceof BlockContentInterface) {

    if ($content['#block_content']-&gt;bundle() == 'xxx') {
      // ...
    }

  }
}