Well you can, it just all big grindfest. Very big one.
5* ticket is got by exchange danchou medals (medal with D on it) which can get by exchange equipments, some quest stage reward, or some events.
Not sure about rainbow medal though... Never get a single of it yet.
Gacha machines consist of current priority, reissued priority, bloomed priority, and premium I think?