The two terms are closely related, and even interchangeable in many cases. However, the two words focus on different things. Alliance is more about mutual interests or benefit, while coalition is more about doing some action.
The use of both terms is not limited to the political context. They can be used in other contexts: military, financial, commercial, technological, and so on. Having said that, I agree that coalition is used most often in the political context for "a temporary alliance of political parties forming a government or of states" (see below).
Here are their definitions, according to Oxford dictionary:
1. A union or association formed for mutual benefit, especially between countries or organizations.
1.1 A relationship based on similarity of interests, nature, or qualities.
1.2 A state of being joined or associated.
coalition (noun) A temporary alliance for combined action, especially of political parties forming a government.
Here is a quote from Get Them On Your Side by Samuel B. Bacharach (chapter 5):
Formally defined, a coalition is a politically mobilized collection of interest groups or individuals committed to achieving a common outcome (i.e., resistance or change). Through political mobilization you create a group that has some sense of shared goals and/or a sense of connected interests. A coalition is an alliance for joint action.
In short, a coalition is an alliance for joint action.