Want to use the same material on two objects,but when trying to change the scale of material on one object the other gets also affected. How can I do it separately.
If you have to use the same material, the most straightforward way would be to use the UV texture space,and give each object a UV map with its own transform (including scale)... but this is a 2D space.. (below)
For 3D, you can use the Generated texture space, and manipulating that on the objects, using ShiftT > S (optionally constraining withXY or Z). (below)
Or, you can use the objects' Pass Indices (set in the Object Properties > Relations panel) to discriminate between objects. In the node tree, That number can be picked up using an Object Info node > Object Index, and used any way you like.