Get CMS Block Collection in Magento 2.

You can get all the CMS Static Blocks collection in Magento 2 by calling interface, Magento\Cms\Api\BlockRepositoryInterface.

Magento\Cms\Api\BlockRepositoryInterface used for getting CMS Static Blocks related data in Magento 2.

BlockRepositoryInterface is used when you need to fetch a collection of CMS Static blocks or get specific CMS static block data. You can get Specific Blocks data by Identifier using  Get Cms Blocks data by an identifier.

You need to instantiate Magento\Cms\Api\BlockRepositoryInterface in __construct() method of Class.

<?php
namespace Rbj\CmsBlock\Block;

class CmsBlock extends \Magento\Framework\View\Element\Template
{
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Cms\Api\BlockRepositoryInterface $blockRepository,
        \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
        array $data = []
    ) {
        $this->blockRepository = $blockRepository;
        $this->searchCriteriaBuilder = $searchCriteriaBuilder;
        parent::__construct($context, $data);
    }

  	/* Get Cms Blocks Collection from store. */
    public function getCmsBlock() {
        $searchCriteria = $this->searchCriteriaBuilder->create();
        $cmsBlocks = $this->blockRepository->getList($searchCriteria)->getItems();
        return $cmsBlocks;
    }

From Template file, You can access all the Static Block by iterate over a loop on a collection.

<?php
	$cmsBlocks = $block->getCmsBlock();
	foreach($cmsBlocks as $cmsBlock) {
	    echo $cmsBlock->getId(); // get Id
	    echo $cmsBlock->getTitle(); // get Title/name of CMS Static Block
        //echo "<pre>";print_r($cmsBlock->getData());
	}
?>

Based on the above Code snippet you get all the Cms Static Blocks from a store. You can also get specific Static Blocks based on your custom condition by refer link.