You can access the steps within a pipeline by their name using the named_steps attributes. After getting the preprocessing step you can then use the transformers_ attribute in combination with standard python indexing to get to the OrdinalEncoder. Using the categories_ attributes then gives you the attributes for the encoder and, since the index of each ...
This is more of a programming question than a data science question and would therefore be better suited for stackoverflow stackexchange, but the following code should do what you're looking for:
df[["A", "C"]] = (
# create groups
# transform the groups by filling na values with ...