A nominal feature has categories with no natural order, such as eye color, city or payment method. An ordinal feature has categories with a meaningful order but no fixed distance between them, such as education level (high school, bachelor's, master's, PhD) or grades A to F. Both are categorical.
The terms come from Stanley Smith Stevens's 1946 levels of measurement: nominal, ordinal, interval and ratio. Nominal data supports counts and the mode. Ordinal data adds the median, percentiles and rank methods such as Spearman's correlation. A mean of ordinal codes assumes the step from A to B equals the step from D to E, which nothing guarantees.
In machine learning, ordinal features are usually encoded as integers in their natural order, 0 to 3 for education, though a linear model then assumes equal steps. Nominal features get one-hot, target or count encoding, since any order would be invented. Binary features like pass/fail are a gray area: one outcome is better, but either way the column is 0/1.