The MAC address is not "stored" in ifconfig or dmesg. ifconfig and dmesg are commands, and only report information stored elsewhere.
A MAC address is a unique identifier assigned to network interfaces for communications on a physical network. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet. MAC addresses are typically assigned by the manufacturer of a network interface controller (NIC) and are stored in its hardware, such as the interfaces's read-only memory or other firmware mechanism. If assigned by the manufacturer, a MAC address usually encodes the manufacturer's registered identification number and may be referred to as the burned-in address (BIA). A MAC address can also be "programmed" onto the NIC by a host device to use an arbitrary address, but that's a whole other topic.