For create block programmatically I use
$block = BlockContent::create([
info''info' => 'block 3',
'type' => 'basic',
'langcode' => 'en',
'body' => [
'value' => '<h1>Block's body</h1>',
'format' => 'full_html',
],
]);
$block->save();
It works good enough but is it possible also to specify region and then on which pages created block must shown on?