“A Dog’s Purpose” has underperformed slightly at the box office as it opened in theaters amid controversy over animal treatment on set and calls for a boycott. Based on early projections, the family film was expected to open in the mid $20-million range, but studio estimates Sunday indicated it took in $18.4 million for a second-place start.