Do Cantonese 畀 and Mandarin 被 have any historical connection?
畀 and 被 are not related.  In Old Chinese (F. K. Li's system) 畀 was pjidh, and 被 was bjiarx/h, phonetically quite different. 

被 (the qusheng reading) was, and still is, a coverlet, etymologically related to the verb 'to cover' (the shangsheng reading). How 'cover' became a marker of passivity in a sentence is a long story; when something is laid on you, it's never you that does the laying, and the fact that it's an action external to you gives it a very passive feeling. 

畀 originally meant 'give' in the sense of to 'bestow'; it came to be a passive marker is a very different fashion from 被; in fact, in most southern dialects, passive is marked by co-verb like structures with the meaning of 'give'; this is a regional feature, though the actual word differs from dialect to dialect; in the Minnan dialect, for example, it is 'ho', and its usage is very similar to 畀 in Yue dialects.