Not sure I understand your question, because there is no reason you cannot have two scenarios that do the same thing but essentially in different ways. You would have to describe the scenarios in slightly different ways ofcourse
Scenario: Given <>
When I <something that indicates that it will be done via UI>
Scenario: Given <>
When I <something that indicates that it will be done via backend.
The above is straightforward, but does have duplication.
Another way would be to create non capturing groups.
Scenario: Given <>
When I (?:<run via UI>|<run via backend>)
And create steps for {run via UI} and {run via backend}
The success of the second method essentially depends on the DSL you use for the steps that are run via UI vs the backend. If the scenarios are intuitive enough it should be fine.