For this conversation I'll use the below definition of cross-entropy where there are N samples, M different classes, $ y_{ij} $ is 1 if sample i is of class j and 0 otherwise and $p_{ij}$ is the probability that a sample i is of class j as assigned by some model.
$$ \text{Cross Entropy Loss} = -\frac{1}{N}\sum_{i}^N \sum_{j}^M y_{ij} log(p_{ij}) $$
Cross entropy assumes that all misclassification costs are of equal importance. So for a given sample of class 1 if an algorithm assigns $p_1 = 0.2$ to class 1 then it doesn't matter how the rest of the probability mass is distributed across the rest of the classes, the loss will be the same. This can be seen from the above definition where the loss depends only on the probability assigned to the true class and has no dependence on how the rest of the probability is distributed.
Imagine we're now in a situation where different misclassifications have different costs eg for a sample of class 1 it costs us twice as much to incorrectly classify it as class 2 than as class 3. Is there a variant of cross entropy which can take into account cost differences of misclassifications?
The best I can come up with is something like:
$$ \text{Loss} = -\frac{1}{N}\sum_{i}^N \sum_{j}^M\sum_{k\neq j}^M y_{ij} C_{jk}log(1-p_{ik}) $$
Where C is a matrix of shape M x M where element $C_{jk}$ is the relative cost of classifying a sample with true class j as class k.
This loss function has some of the right properties in that I can specify relative costs for different types of misclassifications but if all the costs are the same it won't be equal to cross entropy and will have some slightly strange behaviour (for a sample of class 1 if the algorithm predicts $p_1$ for class 1 then it will be minimised when $ p_2 = p_3 $ rather than being agnostic on the values of $p_2$ and $p_3$ as cross entropy is).