Can flour be substituted instead of cornstarch in chocolate pudding?

Not really. You'd have more of a gravy substance instead of pudding.