Custom Blocks as part of a theme

Since you don’t explain what functionality you’re trying to achieve, I assume you want to do one of these thing.

If you’re going to put that block in the post content you can achieve that by using WordPress shortcode

If you’re going to use that block as part of the layout, you might want to use custom widgets instead.

And both of them can be coded as a standalone plugin or coded in the theme as well. Putting it as a separate plugin means that the user needs to deactivate the plugin if he/she wants to remove the functionality, and if you put it in the theme code, the functionality will just disabled when the theme is deactivated.\

I hope that helps.