The answer to this question is yes, but there are two different ways of doing it, and how you can do it depends on the type of component you're working with.
Before I can elaborate, you must understand the difference between the two types of shadow DOMs there are. When you attach a shadow tree to a node, you can either create an open or closed shadow DOM.
Open means that JavaScript from the outside has access to the nodes inside the shadow DOM. That’s usually the default.
The following query returns 1 because there's one element in the shadow DOM of the component.
Closed denies access to the nodes from the outside.
In a closed shadow DOM the same query returns “Cannot read properties of null (reading ‘querySelectorAll’)” because you cannot access the shadow DOM from the outside.
Now that you know that, we can talk about the two solutions.
Accessing the shadowRoot
This solution only works when you're dealing with an open shadow DOM.
When you click the “Focus” button in light DOM, the “Click me” button in shadow DOM receives focus.
Delegating focus
Another solution that works both with an open and closed shadow DOM is focus delegation.
When you attach the shadow, you can pass another option in addition to the mode, delegatesFocus.
When it's true, and you call focus() on the host, the first focusable element in the hosts shadow DOM receives focus.