The vinyl-siding manufacturers make special attachments for mounting receptacle boxes, with trim rings to seal against the siding. The attachments are the same or similar to what is used for railings and faucets:
For small fixtures, it is also possible to just cut a hole for it in the regular siding (and presumably seal with silicone), as shown in the following facsimile from the Vinyl Siding Installation Manual:
Do not simply screw the box through the siding as below; it will be very flimsy.