Is this acceptable for passing data from a module to a template?
If you pass the variables like the following:

class MyBlock extends BlockBase {
  public function build() {
    return [
      '#firstname' =&gt; 'John',
      '#lastname' =&gt; 'Doe',
    ];
  }
}


You can access to your variables #firstname and #lastname like:

{{ content['#firstname'] }}
{{ content['#lastname'] }}