Module Rewrite

I want to rewrite modules if further changes required to it. I want to make magento like flow, if overridden module is present then gives first priority to it, after that goes to default route.

Can IT Be Possible To Acheive This Type Of Flow In Yii2 ?