@Anam Ahmed Thanks for posting in our Q&A.
For this issue, please refer to the following link to set the desktop background on macOS.
https://cloudinfra.net/how-to-set-desktop-wallpaper-on-macos-using-intune/
Note: Non-Microsoft link, just for the reference.
For lockscreen, maybe a Shell script will make it. Honestly, I'm not familiar with it. Hope someone else will share more information.
Thanks for your understanding.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.