How to display form element and label inline
The label placement is something set by the theme you're using, and should be consistent across your site. If all labels are above the corresponding element, you should think twice about changing that position just for one or only a few form elements. If you want all the labels next to the element instead of above, the proper place to change that is in the theme.
But let me answer the question as posed:
There is no need to complicate the document structure by adding container elements for the sole purpose of adding a class. The Form API already wraps input elements with a div, and adds standard classes to these divs, so the trick here is to target the existing div and put your class on that existing div.
You can add your class to the div surrounding the form element by using the totally undocumented property #wrapper_attributes. It is used like this:
'odt-filter' =&gt; [
  '#type' =&gt; 'textfield',
  '#title' =&gt; 'Filtra',
  '#wrapper_attributes' =&gt; [
    'id' =&gt; 'odt-filter',
    'class' =&gt; ['container-inline'],
  ],
] ,

Note this is Drupal 8 so I have changed your example to use short array syntax and I have changed your 'id' attribute to be a string, not an array. You may use both the #attributes and the #wrapper_attributes properties at the same time, in case you wanted to add the class to the div and the id to the input, for example.