Collision in holes( for eg: nut and bolt )

Hi frriends

I want to inset a cylinder in to a pipe at run time. both the objects should have colliders and one should have rigidbody.

find the attached images of input and desired output for more clarification

Just use mesh colliders for both of them. The reason why is because mesh colliders will wrap perfectly around the shape, even if they have holes.

you can not create concave meshcolliders in unity anymore.
i suggest you to take a look at this asset.
(please note that i am not owner nor know the owner of this asset)