From someone who has seen both, Imran was a distance ahead of Wasim in test cricket
Imran is an underrated bowler because his captaincy and his allrounder credentials put his bowling in the shadow.
Incredible as his bowling stats are, they don't do him justice because of the injury-led compromises he made towards the end of his career in speed/effort to prolong his career to the world cup. Yet he averaged 19 with the ball in the 80's over 50 tests.
I remember times, particularly early 80's, and even mid 80's when Wasim was developing, where Imran was the only one whose spells opposition had to see through (and possibly Qadir's) in Pakistan attack. Yet Imran would invariably knock one or two players over in each spell to break partnerships, and then not stop there but continue making inroads to press home the advantage. He was lethal as opening bowler, in the middle of the innings and at the end with the reversing ball. His spells were sustained pace (I'd think early 140s) from beginning to end, and sometimes very long because he was the only one who could take wickets in difficult bowling conditions.
Keep in mind he would shun easy series at home and away (Sri Lanka, New Zealand) in the last few years of his career, and preserve himself for the difficult one's - West Indies, Aus, England, India Away. His five-fers and ten-fers were invariably match winning. Some of his spells - against India at home in early 80s (which I didn't see), against England away in 87, against West indies away in 1st test in '88, against Australia in '77 in Sydney (again didn't see) are what define him as an all time great fast bowler. He has more bowling performances where he decisively won test matches for his country almost on his own, than any other player I know from any team I have watched over 4 decades - maybe only Murali can match.
If he played for England or Austalia, with the amount of cricket they play, he'd have had 600+ wickets in that era when 400 was a dream. Remember Imran was out for 2 1/2 years due to injury when on his absolute peak. In the season prior to his injury, he had taken 62 wickets in just 9 tests - an absolute monster. There is a reason Imran is 3rd in all time ICC bowling rankings in tests (
ICC All Time Test Bowling Rankings).
Akram was an amazing bowler in his own right. I just think he didn't have the kind of bowling influence Imran had in test matches to warrant comparison. ODIs for sure. He does get praised a lot in Australia and England - where he has had magical performances and that puts him in many all time teams. Fair play - because he was definitely a magician.
Two things both had in common - they were both supremely talented (although Imran diverts this bit from himself by focusing more on his "hard work" philosophy) and both were at opposition faces all the time, no quarters given.
If I were to build a test team, I'd put Imran ahead of Akram 10 out of 10 times on bowling alone. If it were an ODI team, I'd take Akram.