the screen of the game is not compatible with all android devices

i want to make screen border to collide with other objects and i am use js

You can make use of the camera.ScreenToWorldPoint(Vector3 position) to determine the edge of the screen. You would then create some box colliders, scale them accordingly and place them relative to the world coordinates of the screen corners. A script which would look something like this would be needed :

//  camera is the gameobject and not the class
Vector3 LowerLeftCorner = camera.ScreenToWorldPoint(new Vector3(0, 0, 0));
Vector3 UpperRightCorner = camera.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, 0))

And you can add to the script the instantiation of 4 gameobjects having a box collider each, scaled so they fit into every direction (up, down, left, right). I cannot type the code for them only from my head, however, so you will need to work on that on your own.