Yes, Cain’s approach to God would have been accepted if Cain had turned to doing good.
إِلَّا أَنَّ قَايِينَ تَجَاهَلَ مَشُورَةَ ٱللهِ ،‏ قَتَلَ أَخَاهُ ،‏ وَٱنْتَهَى بِهِ ٱلْأَمْرُ إِلَى ٱلْعَيْشِ كَمَنْبُوذٍ .‏