Yes, if a company has only two directors, one of them can resign from the company.
However, it is important to ensure that the company continues to have at least two directors at all times, as this is a mandatory requirement under the Companies Act, 2013.
If the resignation of one director leaves the company with only one director, then the remaining director must appoint another director to meet the minimum requirement of two directors.