Instead of hardcoding values, you can define some new styles, and use those in aligned pin. Then you can locally modify those styles as you see fit.
For the black dot that should be red, because that is added as a separate \addplot, you just need to add red to the options there. (Note I removed the dot from the nodes, seems pointless to add dots like that when you already make those dots with the plots.)
There are some comments in the code, ask if anything is unclear.

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{pgfplots}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{ppf2cons}
\tikzset{
declare function={
myslope(\x) = 24 - \x*(24/48);
},
}
\begin{tikzpicture}[
% removed dot, don't need it
% make some new styles
pinlabel/.style={text width=18mm, color=black, fill=yellow!35, xshift=0cm, yshift=0cm, outer sep=0pt, inner sep=5pt},
pinstyle/.style={pin distance=4mm},
% set default style of pin edges, instead of using pin edge={..}
every pin edge/.style={black, very thick, shorten >=-12pt},
aligned pin/.style args={[#1]#2:#3}%
{pin={[pinstyle,
label={[append after command={%
node[pinlabel,%
at=(\tikzlastnode.#2),
anchor=#1,
]{#3}}]center:{}}
]#2:{}}%
},
scale=.9, transform shape]
\begin{axis}[
axis lines=center, axis line style={black, thick,-latex},
axis y line=left, axis x line=bottom,
tick style={line width=.04cm, color=black, line cap=round},
font=\normalsize, color=black,
xmin=0, xmax=64,
xtick={0,12,24,27,48}, xticklabels={0,12,\llap{24},\rlap{27},48},
ymin=0, ymax=30,
ytick={12,13,18,24}, yticklabels={\raisebox{-12pt}{12},\raisebox{8pt}{13},18,24},
tickwidth=.2cm,
xlabel={P},
xlabel style={xshift=.72cm, yshift=0cm}, xlabel style={right},
ylabel={M},
ylabel style={xshift=.2cm, yshift=.6cm}, ylabel style={above},
xticklabel style={inner xsep=0cm, xshift=0cm, yshift=-.1cm},
yticklabel style={inner ysep=0cm, xshift=-.1cm, yshift=0cm},
% remove samples=200 and clip=false
]
% use \addplot
\addplot [ultra thick, blue, samples at={0,12,24,48}, mark=*, mark options={black}] {myslope(x)};
% add red here
\addplot [ultra thick, mark=*, red] coordinates {(27,13)};
% remove scale=0.8,dot from the following three nodes, add coordinate and {} at end
% use scoped (shorthand of scope environment) to locally modify the styles defined above
\scoped[pinlabel/.append style={text width=25mm,fill=blue!20}]
\node at (axis cs:12,{myslope(12)}) [coordinate, aligned pin={[south west]65:bla bla bla bla bla bla}] {};
\scoped[pinstyle/.append style={pin distance=3cm}]
\node at (axis cs:24,{myslope(24)}) [coordinate, aligned pin={[south west]45:bla bla bla bla bla bla}] {};
\scoped[every pin edge/.append style={red}]
\node at (axis cs:27,13) [coordinate, aligned pin={[west]-10:\textcolor {red}{bla bla bla bla bla bla}}] {};
\draw [thick, black, densely dotted] (axis cs:0,{myslope(12)}) -- (axis cs:12,{myslope(12)}) node [black, xshift=.46cm, yshift=.05cm] {} -- (axis cs:12,0);
\draw [thick, black, densely dotted] (axis cs:0,{myslope(24)}) -- (axis cs:24,{myslope(24)}) node [blue, xshift=-.34cm, yshift=-.3cm] {B} -- (axis cs:24,0);
\draw [thick, red, densely dotted] (axis cs:0,13) -| node [red, xshift=.46cm, yshift=.1cm] {B*} (axis cs:27,0);
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
Addendum
If you want complete control over the look of each individual dot separately, you could just as well add the dot style back in, and then use \node [dot, aligned pin=.... Then you can just add options after dot to control those things, e.g. \node [dot, minimum size=30pt, blue, aligned pin=... to make a massive blue dot.
To change the size of the plotted markers, you use mark size, i.e. \addplot [..., mark size=10pt] .... Note that mark size sets the radius, while minimum size (for nodes) sets the diameter.
I modified dot slightly here.
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{pgfplots}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{ppf2cons}
\tikzset{
declare function={
myslope(\x) = 24 - \x*(24/48);
},
}
\begin{tikzpicture}[
% changed size of dot
dot/.style = {circle, black, inner sep=0,minimum size=6pt, fill, node contents={}},
% make some new styles
pinlabel/.style={text width=18mm, color=black, fill=yellow!35, xshift=0cm, yshift=0cm, outer sep=0pt, inner sep=5pt},
pinstyle/.style={pin distance=4mm},
% set default style of pin edges, instead of using pin edge={..}
every pin edge/.style={black, very thick, shorten >=-12pt},
aligned pin/.style args={[#1]#2:#3}%
{pin={[pinstyle,
label={[append after command={%
node[pinlabel,%
at=(\tikzlastnode.#2),
anchor=#1,
]{#3}}]center:{}}
]#2:{}}%
},
scale=.9, transform shape]
\begin{axis}[
axis lines=center, axis line style={black, thick,-latex},
axis y line=left, axis x line=bottom,
tick style={line width=.04cm, color=black, line cap=round},
font=\normalsize, color=black,
xmin=0, xmax=64,
xtick={0,12,24,27,48}, xticklabels={0,12,\llap{24},\rlap{27},48},
ymin=0, ymax=30,
ytick={12,13,18,24}, yticklabels={\raisebox{-12pt}{12},\raisebox{8pt}{13},18,24},
tickwidth=.2cm,
xlabel={P},
xlabel style={xshift=.72cm, yshift=0cm}, xlabel style={right},
ylabel={M},
ylabel style={xshift=.2cm, yshift=.6cm}, ylabel style={above},
xticklabel style={inner xsep=0cm, xshift=0cm, yshift=-.1cm},
yticklabel style={inner ysep=0cm, xshift=-.1cm, yshift=0cm},
% remove samples=200 and clip=false
]
% use \addplot! changed the samples at=
% mark size sets the radius of all the markers in this plot
\addplot [ultra thick, blue, samples at={0,48}, mark=*, mark size=10pt,mark options={black}] {myslope(x)};
% remove this
%\addplot [ultra thick, mark=*, red] coordinates {(27,13)};
% use scoped (shorthand of scope environment) to locally modify the styles defined above
\scoped[pinlabel/.append style={text width=25mm,fill=blue!20}]
% just as example: add minimum size=12pt to make this one larger minimum size sets the diameter
\node at (axis cs:12,{myslope(12)}) [dot, minimum size=12pt, aligned pin={[south west]65:bla bla bla bla bla bla}];
\scoped[pinstyle/.append style={pin distance=3cm}]
\node at (axis cs:24,{myslope(24)}) [dot, aligned pin={[south west]45:bla bla bla bla bla bla}];
\scoped[every pin edge/.append style={red}]
% add red after dot
\node at (axis cs:27,13) [dot, red, aligned pin={[west]-10:\textcolor {red}{bla bla bla bla bla bla}}];
\draw [thick, black, densely dotted] (axis cs:0,{myslope(12)}) -- (axis cs:12,{myslope(12)}) node [black, xshift=.46cm, yshift=.05cm] {} -- (axis cs:12,0);
\draw [thick, black, densely dotted] (axis cs:0,{myslope(24)}) -- (axis cs:24,{myslope(24)}) node [blue, xshift=-.34cm, yshift=-.3cm] {B} -- (axis cs:24,0);
\draw [thick, red, densely dotted] (axis cs:0,13) -| node [red, xshift=.46cm, yshift=.1cm] {B*} (axis cs:27,0);
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
B*that your question mentioned), then it's better to usedotthe way you had it, and not add markers there in the plots, i.e. usesamples at={0,48}in the first\addplot, and remove the second\addplotaltogether. Thendot,redwill give you a red dot, for example. – Torbjørn T. Jul 13 '18 at 06:33dotback in, the way it was in your original code. My other modifications you can of course leave as it was, they are independent of thedot. I'll edit. – Torbjørn T. Jul 13 '18 at 07:33mark size. Addingmark size=20ptfor example to the\addplotoptions will make them rather large. – Torbjørn T. Jul 13 '18 at 07:42