For the aïoli: Put garlic and a pinch of salt into a mortar and crush with a pestle into a paste. Transfer paste to a bowl; add mayonnaise, lemon juice, parsley, and salt to taste; stir well. Cover aïoli with plastic wrap, pressing it against surface; refrigerate.
For the fritters: Heat oil in a large pot over medium-high heat. Add shallots and cook, stirring, until softened, about 1 minute. Add wine, 1⁄4 cup water, and cockles and cook, covered, stirring occasionally, until cockles have opened, 7–8 minutes. Remove from heat and, using a slotted spoon, transfer cockles to a bowl, leaving liquid behind. When cockles have cooled, remove from shells and roughly chop meat; set aside. Meanwhile, strain liquid through a cheesecloth-lined sieve into a small saucepan and simmer vigorously over medium heat until slightly thickened, 8–10 minutes; set aside.
Preheat broiler. Heat butter in an 8" nonstick ovenproof skillet over medium-high heat. Put cockles, eggs, and 2–3 tsp. of the clam liquid into a medium bowl and stir well. (Reserve remaining clam liquid for another use.) Add cockle mixture to skillet and cook, lifting edges with a rubber spatula to let egg run underneath, until slightly set and underside is light golden brown, about 3 minutes. Broil fritter until completely set and light golden brown on top, about 4 minutes. Invert fritter onto a cutting board, cut into 4 wedges, and serve with a dollop of aïoli and with a wedge of lemon, if you like.