Possible, yes. Reasonable, I'm not so sure. Sounds like a fool's errand.
Say you have an 8-pin device, that means (I think) there are 64 possible configurations, and one correct one. Are you assuming the device under test is always a single opamp?
No. I need to design a circuit which could test the functional and test parameters of a wide range of op amps(8, 10, 14, 16 pin opamps). It should be designed in such a way that when an DUT is placed in the socket it should identify the input and output pins automatically
I think it's not completely impossible, but requires a complex identification sequence. Some assumptions about the OPs are probably necessary. You have e.g. OPs with 5V maximum supply and others that won't work with 5V at all. Also auxilary pins like disable or enable might cause confusion.
You'll start with identifying of the supply pins by measuring substrate diodes. The find the output pin, etc....
I must confess that identifying arbitrary OPs looks to me at first sight as a gadget rather than a productive problem solution.
Insert op-amp into socket .
Read writing on top of op-amp.
Copy writing into Google.
Find op-amp datasheet and look-up pin mapping :0)
Sorry , could not resist :0)