Hey Abhishek,
If you require to create your own object detection algortihm then you can reference the following documentation and examples. It goes through the steps and explanations necessary to perform classifictation using CNNs and create customised detectors:
Once you have a working object detection algorithm and have the bounding box coordinate, you can augment a bounding box around an object at the desired coordinates by following the below documentation:
In case you are dealing with video instead of images, then the following MATLAB Answer should help you: