How can add extra info to the  tag?
You can use the following code, even though for those specific values, I would find a different way (e.g. setting the language for the shown page).

{% html_attributes.setAttribute("lang", "ar") %}
{% html_attributes.setAttribute("dir", "rtl") %}
&lt;html{{ html_attributes }}&gt;


Inside hook_preprocess_html(), since $variables['html_attributes'] is an Attribute object, so you can use Attribute::setAttribute(). 

$variables['html_attributes']-&gt;setAttribute("lang", "ar");
$variables['html_attributes']-&gt;setAttribute("dir", "rtl");