Can a human who is pious can perform miracles by the permission of Allah or only prophets and Imams will do it?

They can have what is known as karamat (blessings). Miracles are only for Prophets.