first cited in 1919, according to OED:

c. slang (orig. Mil.). To sell or offer for sale, orig. illicitly.

1919 [Implied in FLOGGING vbl. n. 2d.]. 1925 FRASER & GIBBONS Soldier & Sailor Words 96 To flog, to sell something not the vendor's own to dispose of. 1951 G. HANLEY Consul at Sunset 125 He was dead... His kit was collected and flogged to those who would buy it in the mess. 1966 J. PORTER Sour Cream x. 134 Filching state property and flogging it to the eager populace is a common enough crime in the Soviet Union as it was with us during the war. 1967 M. DRABBLE Jerusalem the Golden v. 112 Let's go..and look at the ghastly thing that Martin flogged us.

[1919 War Terms in Athenæum 1 Aug. 695/2 ‘Flogging’, the illegal disposal of Army goods. ]