1560s, a general term of endearment (also puggy), perhaps related to or a variant of puck (n.2); one of the earliest senses of pug is "sprite, imp" (1610s). The sense of "miniature dog" is from 1749 (pug-dog); that of "monkey" is from 1660s, perhaps on the notion of having a pert, ugly face like a little imp.
In John Milesius any man may reade
Of divels in Sarmatia honored
Call'd Kottri or Kibaldi ; such as wee
Pugs and hobgoblins call. Their dwellings bee
In corners of old houses least frequented,
Or beneath stacks of wood ; and these convented
Make fearfull noise in buttries and in dairies,
Robin good-fellowes some, some call them fairies.
[Thomas Heywood, "Hierarchie of the Blessed Angells," 1635]
The word, or identical words, at various times also meant "a husk of grain" (mid-15c.), "a bargeman" (1590s), "a harlot" (c. 1600), and "an upper servant in a great house" (1843), the last, if it is authentic, perhaps with a suggestion of "lap dog."
"I've seen him, father," said Nelly with a consequential air, "the day I was up at Fairfield Court; he came into Pug's Hole while the old lady was talking to me." For the benefit of the unlearned it should be mentioned that the under-servants "in respectable families" call upper-servants "Pugs;" and that the housekeeper's room is designated as "Pug's Hole." [F.E. Paget, "Warden of Berkingholt," 1843]