There a no inbuilt function/s within UiPath to identify or segment a background in the image.
Building an image background estimater / segmenter is quite a complex problem.
Inorder to know where and what is the background, in each image we should be able to detect and segment the object in focus. For example a person sitting and a background of a mountain. Only if you can segment the person, can you segment the background.
Typical example is video bluring of the background in a Teams meeting.
Your best bet is to start with Open CV in python, but soon you will realize the background extracter will be quite limited when you introduce different images.
If you further use Machine Vision based background extracters then you will have to train the model with what is background and what is the foregroun object in focus in your use-case. It is very easy to set this up, but to validate its metrics is another ball game.
In summary depending on your case, you need to investigate further if it is worthwhile implementing this yourself.
As a start you could try if the inbuilt Windows 365 feature helps you remove background, but then again this will remove background not get you the background: Remove the background of a picture (microsoft.com)