Let $C$ be a category. Then by definition, for very ordered triple $A,B,C$ of objects, there is a law of composition of morphisms, i.e., a map $$Hom_C(A,B)\times Hom_C(B,C)\longrightarrow Hom_C(A,C)$$ where $(f,g)\mapsto gf$.
I was wondering if it is possible in the definition that $Hom_C(A,C)=\emptyset$ when the other two are not empty.
No, that is not possible:
If we have a function $X\to\emptyset$, then $X=\emptyset$, because for every $x\in X$ there should be an assigned element in the codomain.
If, however, $\hom(A,B)\ne\emptyset$ and $\hom(B,C)\ne\emptyset$, then their Cartesian product is nonempty either.