Is it alright to use 3d Box Colliders on 2d gameObjects?

As the title says, I wanted to know if I can use 3d colliders on 2d gameObjects.
Let’s say I want a 2d character to walk a hallway , and on the hallway there’s a trap behind on the z axis of the character . The trap would move with the collider so It could touch the character’s collider . The problem is the collision won’t happen. Neither with triggers or normal collision.
I used

void OnCollisionEnter(Collision col) { Debug.Log ("Done"); Destroy(col.gameObject); }

To invoke collisions, one of the objects must have a rigidbody. I don´t know about this combo but it doesnt seem right, You could instead put on 2D collider and enable it in the moment when you want the player to be trapped and keep it disabled for the rest of the time.