A rat terrier and a chihuahua can mate because both are small breeds, but the size difference creates risks. The chihuahua is much smaller and could be injured during mating or have difficulty giving birth to larger puppies.
Before breeding, have both dogs examined by a veterinarian. The smaller dog will need extra care during pregnancy and whelping, and the puppies will require attentive care after birth.
Carefully consider health, size compatibility, and your ability to support the mother and litter before proceeding.